anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / qgnomeplatform / qt6-cursor-fix.patch
blob40438aae33edcd1793c370538e0dc8c4e0941037
1 diff --git a/src/common/gnomesettings.cpp b/src/common/gnomesettings.cpp
2 index 961f75d..d947eb2 100644
3 --- a/src/common/gnomesettings.cpp
4 +++ b/src/common/gnomesettings.cpp
5 @@ -210,7 +210,7 @@ GnomeSettingsPrivate::GnomeSettingsPrivate(QObject *parent)
6 QStringLiteral("SettingChanged"), this, SLOT(portalSettingChanged(QString,QString,QDBusVariant)));
9 - if (QGuiApplication::platformName() != QStringLiteral("xcb")) {
10 + if (true) {
11 cursorSizeChanged();
12 cursorThemeChanged();
14 @@ -347,11 +347,11 @@ void GnomeSettingsPrivate::gsettingPropertyChanged(GSettings *settings, gchar *k
15 } else if (changedProperty == QStringLiteral("monospace-font-name")) {
16 gnomeSettings->fontChanged();
17 } else if (changedProperty == QStringLiteral("cursor-size")) {
18 - if (QGuiApplication::platformName() != QStringLiteral("xcb")) {
19 + if (true) {
20 gnomeSettings->cursorSizeChanged();
22 } else if (changedProperty == QStringLiteral("cursor-theme")) {
23 - if (QGuiApplication::platformName() != QStringLiteral("xcb")) {
24 + if (true) {
25 gnomeSettings->cursorThemeChanged();
27 // Org.gnome.wm.preferences
28 @@ -393,13 +393,23 @@ void GnomeSettingsPrivate::cursorBlinkTimeChanged()
29 void GnomeSettingsPrivate::cursorSizeChanged()
31 int cursorSize = getSettingsProperty<int>(QStringLiteral("cursor-size"));
32 - qputenv("XCURSOR_SIZE", QString::number(cursorSize).toUtf8());
33 + if (QGuiApplication::platformName() != QStringLiteral("xcb")) {
34 + qputenv("XCURSOR_SIZE", QString::number(cursorSize).toUtf8());
35 + }
36 +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
37 + m_hints[QPlatformTheme::MouseCursorSize] = QSize(cursorSize, cursorSize);
38 +#endif
41 void GnomeSettingsPrivate::cursorThemeChanged()
43 const QString cursorTheme = getSettingsProperty<QString>(QStringLiteral("cursor-theme"));
44 - qputenv("XCURSOR_THEME", cursorTheme.toUtf8());
45 + if (QGuiApplication::platformName() != QStringLiteral("xcb")) {
46 + qputenv("XCURSOR_THEME", cursorTheme.toUtf8());
47 + }
48 +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
49 + m_hints[QPlatformTheme::MouseCursorTheme] = cursorTheme;
50 +#endif
53 void GnomeSettingsPrivate::fontChanged()