Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
dde-appearance (1.1.74) unstable; urgency=medium

* fix: handle cursor size configuration changes

-- zhangkun <zhangkun2@uniontech.com> Mon, 08 Dec 2025 09:37:00 +0800

dde-appearance (1.1.73) unstable; urgency=medium

* feat: add cursor size configuration support
Expand Down
8 changes: 5 additions & 3 deletions src/service/impl/appearancemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ void AppearanceManager::handleXsettingDConfigChange(QString key)
} else if (key == DCKEYDTKWINDOWRADIUS) {
m_property->windowRadius = m_XSettingsDconfig->value(DCKEYDTKWINDOWRADIUS).toInt();
Q_EMIT Changed("WindowRadius", QString::number(m_property->windowRadius));
} else if (key == DCKEYCURSORSIZEBASE) {
m_property->cursorSize = m_XSettingsDconfig->value(DCKEYCURSORSIZEBASE).toInt();
Q_EMIT Changed("CursorSize", QString::number(m_property->cursorSize));
}
}

Expand Down Expand Up @@ -1072,16 +1075,15 @@ bool AppearanceManager::doSetCursorTheme(QString value)
}

auto getSuitableCursorSize = [this, value]() {
int cursorSize = - 1;
int cursorSize = 24;
for (auto iter : m_subthemes->listCursorThemes()) {
if (iter->getId() == value) {
auto availableSizes = utils::getAvailableCursorSizes(iter->getPath());
int len = INT_MAX;
int value = -1;
for (auto size : availableSizes) {
if (std::abs(size - m_property->cursorSize) < len) {
len = std::abs(size - m_property->cursorSize);
value = size;
cursorSize = size;
}
}
break;
Expand Down
4 changes: 2 additions & 2 deletions src/service/modules/api/themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ bool ThemesApi::setCursorSize(int size)

if (QGSettings::isSchemaInstalled("org.gnome.desktop.interface")) {
QGSettings gtkSettings("org.gnome.desktop.interface", QByteArray(), this);
if (gtkSettings.keys().contains("cursor-size")) {
gtkSettings.set("cursor-size", size);
if (gtkSettings.keys().contains("cursorSize")) {
gtkSettings.set("cursorSize", size);
}
}

Expand Down