From f71e1c23c059328e0f717d339217476c46bceb5e Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Wed, 28 Aug 2019 12:29:45 +0200 Subject: [PATCH] Fix cursor size on wayland --- qgnomeplatform-fix-cursor-size.patch | 50 ++++++++++++++++++++++++++++ qgnomeplatform.spec | 6 +++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 qgnomeplatform-fix-cursor-size.patch diff --git a/qgnomeplatform-fix-cursor-size.patch b/qgnomeplatform-fix-cursor-size.patch new file mode 100644 index 0000000..ce1f15b --- /dev/null +++ b/qgnomeplatform-fix-cursor-size.patch @@ -0,0 +1,50 @@ +diff --git a/common/gnomehintssettings.cpp b/common/gnomehintssettings.cpp +index 4dfe990..b50bd34 100644 +--- a/common/gnomehintssettings.cpp ++++ b/common/gnomehintssettings.cpp +@@ -119,8 +119,10 @@ GnomeHintsSettings::GnomeHintsSettings() + m_hints[QPlatformTheme::IconPixmapSizes] = QVariant::fromValue(QList() << 512 << 256 << 128 << 64 << 32 << 22 << 16 << 8); + m_hints[QPlatformTheme::PasswordMaskCharacter] = QVariant(QChar(0x2022)); + ++ cursorSizeChanged(); ++ + // Watch for changes +- QStringList watchList = { "changed::gtk-theme", "changed::icon-theme", "changed::cursor-blink-time", "changed::font-name", "changed::monospace-font-name" }; ++ QStringList watchList = { "changed::gtk-theme", "changed::icon-theme", "changed::cursor-blink-time", "changed::font-name", "changed::monospace-font-name", "changed::cursor-size" }; + + for (const QString &watchedProperty : watchList) { + g_signal_connect(m_settings, watchedProperty.toStdString().c_str(), G_CALLBACK(gsettingPropertyChanged), this); +@@ -174,6 +176,8 @@ void GnomeHintsSettings::gsettingPropertyChanged(GSettings *settings, gchar *key + gnomeHintsSettings->fontChanged(); + } else if (changedProperty == QLatin1String("monospace-font-name")) { + gnomeHintsSettings->fontChanged(); ++ } else if (changedProperty == QLatin1String("cursor-size")) { ++ gnomeHintsSettings->cursorSizeChanged(); + } else { + qCDebug(QGnomePlatform) << "GSetting property change: " << key; + } +@@ -204,6 +208,12 @@ void GnomeHintsSettings::cursorBlinkTimeChanged() + } + } + ++void GnomeHintsSettings::cursorSizeChanged() ++{ ++ int cursorSize = getSettingsProperty(QStringLiteral("cursor-size")); ++ qputenv("XCURSOR_SIZE", QString::number(cursorSize).toUtf8()); ++} ++ + void GnomeHintsSettings::fontChanged() + { + const QFont oldSysFont = *m_fonts[QPlatformTheme::SystemFont]; +diff --git a/common/gnomehintssettings.h b/common/gnomehintssettings.h +index a1ce4a1..aaaa454 100644 +--- a/common/gnomehintssettings.h ++++ b/common/gnomehintssettings.h +@@ -102,6 +102,7 @@ public: + + public Q_SLOTS: + void cursorBlinkTimeChanged(); ++ void cursorSizeChanged(); + void fontChanged(); + void iconsChanged(); + void themeChanged(); diff --git a/qgnomeplatform.spec b/qgnomeplatform.spec index 03367e4..2d9924b 100644 --- a/qgnomeplatform.spec +++ b/qgnomeplatform.spec @@ -1,7 +1,7 @@ Name: qgnomeplatform Version: 0.5 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Qt Platform Theme aimed to accommodate Gnome settings License: LGPLv2+ @@ -10,6 +10,7 @@ Source0: https://github.com/MartinBriza/QGnomePlatform/archive/%{version} # Upstream patches Patch0: qgnomeplatform-gnome-decorations.patch +Patch1: qgnomeplatform-fix-cursor-size.patch BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(udev) @@ -58,6 +59,9 @@ make install INSTALL_ROOT=%{buildroot} -C %{_target_platform} %{_qt5_libdir}/qt5/plugins/wayland-decoration-client/libqgnomeplatformdecoration.so %changelog +* Wed Aug 28 2019 Jan Grulich - 0.5-13 +- Fix cursor size on wayland + * Thu Aug 15 2019 Jan Grulich - 0.5-12 - Add Gnome-like wayland decorations BUG: bz#1732129