GNOME Bugzilla – Bug 711703
change cursor theme for qt applications as well as gtk
Last modified: 2017-10-28 22:01:18 UTC
Currently, changing the cursor in gtt only sets the cursor theme for gtk apps (supposedly via dconf). Qt apps in my limited knowledge either ignore or use a different method for switching their cursors and therefore continue using the default one (in arch linux this is a black bitmap cursor). To change this I had to create a ~/.icons/default/index.theme file and add: [Icon Theme] Name=Default Inherits=$(CURSOR_THEME) # in my case this is DMZ-White alternatively /usr/share/icons/default/index.theme can be used but it will apply settings globally and is then not good for multi-user PCs.
I'm having the same issue currently with Gnome 3.12.2 on Arch Linux x86_64. Looks like the XCURSOR_THEME environment variable is not set correctly and applications who use it fallback to the system default. Applications affected and related bug reports: * Google Chrome - https://code.google.com/p/chromium/issues/detail?id=356228 * Steam - https://github.com/ValveSoftware/steam-for-linux/issues/825 * VLC, QSynth and probably every Qt application
Setting environment variables is not a viable method of communicating settings like that.
GTK+ is getting this information from the Gtk/CursorThemeName setting.
*** Bug 730869 has been marked as a duplicate of this bug. ***
(In reply to Matthias Clasen from comment #2) > Setting environment variables is not a viable method of communicating > settings like that. What is the viable method then for apps that are not GTK+ based? :/ Thanks a lot for your help
See comment 3, XSettings are a way for Desktop environments to export important settings like this one.
(In reply to Matthias Clasen from comment #6) > See comment 3, XSettings are a way for Desktop environments to export > important settings like this one. Well, as far as I can tell, libXcursor, which is what everyone is using to draw their cursors, currently is using an env variable for it instead of XSettings. So for now, in Gentoo, we've added the following to xinitrc.d: if [ "$DESKTOP_SESSION" = "gnome" -o "$DESKTOP_SESSION" = "cinnamon" ]; then XCURSOR_THEME=`dconf read /org/gnome/desktop/interface/cursor-theme` 2> /dev/null if [ x"$XCURSOR_THEME" = "x" ]; then export XCURSOR_THEME="Adwaita" else # 'dconf read' wraps string output in single quotes eval export "XCURSOR_THEME=$XCURSOR_THEME" fi fi
It just doesn't work. There is no way to inject new environment variables into a running process from the outside. If Qt doesn't offer a supportable way to change the cursor theme at runtime, then we can't support qt apps.
Qt tries to support you. See qxcbcursor.cpp:546 QByteArray gtkCursorTheme = m_screen->xSettings()->setting("Gtk/CursorThemeName").toByteArray(); m_screen->xSettings()->registerCallbackForProperty("Gtk/CursorThemeName",cursorThemePropertyChanged,this); It should just work, though it seems it's only going to look in the GTK settings /if/ it failed to find a cursor in the current (default) theme, which is arguably a bit wrong. Mateus or Alexandr are you in a position to rebuild Qt? Could you remove the !cursor from the start of line 544 and see if that makes things work?
David, thanks thats appreciated!
Is there anything that still needs done for this issue?
just testing and verifying that it works
It appears to work here. The only Qt app I regularly use is VirtualBox and I haven't noticed the cursor changing when I use that app. Can anyone still reproduce the original issue on a recent distro?
On my installation it works fine. Just note for test purpose that I do have the wrong cursor when I just changed it from the tweak tools and that I pass it over a Qt window, but after closing+reopening the window the cursor is correctly set.
I am closing this bug report as it doesn't seem to be reproducible any more. Please feel free to open a new bug with detailed information if there is still an issue.