diff --git a/pkgs/development/libraries/qgnomeplatform/default.nix b/pkgs/development/libraries/qgnomeplatform/default.nix index b32414f855d0..8136482d477b 100644 --- a/pkgs/development/libraries/qgnomeplatform/default.nix +++ b/pkgs/development/libraries/qgnomeplatform/default.nix @@ -33,6 +33,10 @@ stdenv.mkDerivation rec { src = ./hardcode-gsettings.patch; gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas; }) + + # Backport cursor fix for Qt6 apps + # Ajusted from https://github.com/FedoraQt/QGnomePlatform/pull/138 + ./qt6-cursor-fix.patch ]; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/qgnomeplatform/qt6-cursor-fix.patch b/pkgs/development/libraries/qgnomeplatform/qt6-cursor-fix.patch new file mode 100644 index 000000000000..40438aae33ed --- /dev/null +++ b/pkgs/development/libraries/qgnomeplatform/qt6-cursor-fix.patch @@ -0,0 +1,53 @@ +diff --git a/src/common/gnomesettings.cpp b/src/common/gnomesettings.cpp +index 961f75d..d947eb2 100644 +--- a/src/common/gnomesettings.cpp ++++ b/src/common/gnomesettings.cpp +@@ -210,7 +210,7 @@ GnomeSettingsPrivate::GnomeSettingsPrivate(QObject *parent) + QStringLiteral("SettingChanged"), this, SLOT(portalSettingChanged(QString,QString,QDBusVariant))); + } + +- if (QGuiApplication::platformName() != QStringLiteral("xcb")) { ++ if (true) { + cursorSizeChanged(); + cursorThemeChanged(); + } +@@ -347,11 +347,11 @@ void GnomeSettingsPrivate::gsettingPropertyChanged(GSettings *settings, gchar *k + } else if (changedProperty == QStringLiteral("monospace-font-name")) { + gnomeSettings->fontChanged(); + } else if (changedProperty == QStringLiteral("cursor-size")) { +- if (QGuiApplication::platformName() != QStringLiteral("xcb")) { ++ if (true) { + gnomeSettings->cursorSizeChanged(); + } + } else if (changedProperty == QStringLiteral("cursor-theme")) { +- if (QGuiApplication::platformName() != QStringLiteral("xcb")) { ++ if (true) { + gnomeSettings->cursorThemeChanged(); + } + // Org.gnome.wm.preferences +@@ -393,13 +393,23 @@ void GnomeSettingsPrivate::cursorBlinkTimeChanged() + void GnomeSettingsPrivate::cursorSizeChanged() + { + int cursorSize = getSettingsProperty(QStringLiteral("cursor-size")); +- qputenv("XCURSOR_SIZE", QString::number(cursorSize).toUtf8()); ++ if (QGuiApplication::platformName() != QStringLiteral("xcb")) { ++ qputenv("XCURSOR_SIZE", QString::number(cursorSize).toUtf8()); ++ } ++#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) ++ m_hints[QPlatformTheme::MouseCursorSize] = QSize(cursorSize, cursorSize); ++#endif + } + + void GnomeSettingsPrivate::cursorThemeChanged() + { + const QString cursorTheme = getSettingsProperty(QStringLiteral("cursor-theme")); +- qputenv("XCURSOR_THEME", cursorTheme.toUtf8()); ++ if (QGuiApplication::platformName() != QStringLiteral("xcb")) { ++ qputenv("XCURSOR_THEME", cursorTheme.toUtf8()); ++ } ++#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) ++ m_hints[QPlatformTheme::MouseCursorTheme] = cursorTheme; ++#endif + } + + void GnomeSettingsPrivate::fontChanged()