summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3theme.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
index c2bc49af47..313fd40b9f 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp
@@ -102,6 +102,20 @@ QGtk3Theme::QGtk3Theme()
SETTING_CONNECT("gtk-application-prefer-dark-theme");
SETTING_CONNECT("gtk-theme-name");
#undef SETTING_CONNECT
+
+ /* Set XCURSOR_SIZE and XCURSOR_THEME for Wayland sessions */
+ if (QGuiApplication::platformName().startsWith("wayland"_L1)) {
+ if (qEnvironmentVariableIsEmpty("XCURSOR_SIZE")) {
+ const int cursorSize = gtkSetting<gint>("gtk-cursor-theme-size");
+ if (cursorSize > 0)
+ qputenv("XCURSOR_SIZE", QString::number(cursorSize).toUtf8());
+ }
+ if (qEnvironmentVariableIsEmpty("XCURSOR_THEME")) {
+ const QString cursorTheme = gtkSetting("gtk-cursor-theme-name");
+ if (!cursorTheme.isEmpty())
+ qputenv("XCURSOR_THEME", cursorTheme.toUtf8());
+ }
+ }
}
static inline QVariant gtkGetLongPressTime()