Skip to content

Commit 748ec7f

Browse files
committed
fix: handle cursor size configuration changes
1. Added handling for cursor size changes from XSettings DConfig in AppearanceManager 2. Fixed cursor size initialization from 24 instead of -1 when selecting cursor theme 3. Corrected GSettings key from "cursor-size" to "cursorSize" for GNOME desktop interface compatibility Log: Fixed cursor size configuration handling and GNOME desktop integration Influence: 1. Test cursor size changes through DConfig settings 2. Verify cursor theme switching with different available sizes 3. Test GNOME desktop compatibility with cursor size settings 4. Verify cursor size persistence across system restarts 5. Test cursor size changes in different desktop environments fix: 处理光标大小配置变更 1. 在 AppearanceManager 中添加了对 XSettings DConfig 中光标大小变更的 处理 2. 修复了选择光标主题时,光标大小从24而不是-1初始化的逻辑 3. 更正了 GNOME 桌面接口的 GSettings 键值,从 "cursor-size" 改为 "cursorSize" 以提升兼容性 Log: 修复了光标大小配置处理和 GNOME 桌面集成问题 Influence: 1. 测试通过 DConfig 设置更改光标大小的功能 2. 验证在不同可用尺寸下切换光标主题的功能 3. 测试光标大小设置在 GNOME 桌面环境下的兼容性 4. 验证光标大小在系统重启后的持久性 5. 测试在不同桌面环境下更改光标大小的功能
1 parent 76519e8 commit 748ec7f

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
dde-appearance (1.1.74) unstable; urgency=medium
2+
3+
* fix: handle cursor size configuration changes
4+
5+
-- zhangkun <[email protected]> Mon, 08 Dec 2025 09:37:00 +0800
6+
17
dde-appearance (1.1.73) unstable; urgency=medium
28

39
* feat: add cursor size configuration support

src/service/impl/appearancemanager.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ void AppearanceManager::handleXsettingDConfigChange(QString key)
275275
} else if (key == DCKEYDTKWINDOWRADIUS) {
276276
m_property->windowRadius = m_XSettingsDconfig->value(DCKEYDTKWINDOWRADIUS).toInt();
277277
Q_EMIT Changed("WindowRadius", QString::number(m_property->windowRadius));
278+
} else if (key == DCKEYCURSORSIZEBASE) {
279+
m_property->cursorSize = m_XSettingsDconfig->value(DCKEYCURSORSIZEBASE).toInt();
280+
Q_EMIT Changed("CursorSize", QString::number(m_property->cursorSize));
278281
}
279282
}
280283

@@ -1072,16 +1075,15 @@ bool AppearanceManager::doSetCursorTheme(QString value)
10721075
}
10731076

10741077
auto getSuitableCursorSize = [this, value]() {
1075-
int cursorSize = - 1;
1078+
int cursorSize = 24;
10761079
for (auto iter : m_subthemes->listCursorThemes()) {
10771080
if (iter->getId() == value) {
10781081
auto availableSizes = utils::getAvailableCursorSizes(iter->getPath());
10791082
int len = INT_MAX;
1080-
int value = -1;
10811083
for (auto size : availableSizes) {
10821084
if (std::abs(size - m_property->cursorSize) < len) {
10831085
len = std::abs(size - m_property->cursorSize);
1084-
value = size;
1086+
cursorSize = size;
10851087
}
10861088
}
10871089
break;

src/service/modules/api/themes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,8 @@ bool ThemesApi::setCursorSize(int size)
707707

708708
if (QGSettings::isSchemaInstalled("org.gnome.desktop.interface")) {
709709
QGSettings gtkSettings("org.gnome.desktop.interface", QByteArray(), this);
710-
if (gtkSettings.keys().contains("cursor-size")) {
711-
gtkSettings.set("cursor-size", size);
710+
if (gtkSettings.keys().contains("cursorSize")) {
711+
gtkSettings.set("cursorSize", size);
712712
}
713713
}
714714

0 commit comments

Comments
 (0)