After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711703 - change cursor theme for qt applications as well as gtk
change cursor theme for qt applications as well as gtk
Status: RESOLVED INCOMPLETE
Product: gnome-tweak-tool
Classification: Applications
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Tweak Tool maintainer(s)
GNOME Tweak Tool maintainer(s)
: 730869 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-11-08 17:56 UTC by Marco Scannadinari
Modified: 2017-10-28 22:01 UTC
See Also:
GNOME target: ---
GNOME version: 3.11/3.12



Description Marco Scannadinari 2013-11-08 17:56:51 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.
Comment 1 Mateus Rodrigues Costa 2014-07-10 17:25:59 UTC
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
Comment 2 Matthias Clasen 2014-08-22 02:05:54 UTC
Setting environment variables is not a viable method of communicating settings like that.
Comment 3 Matthias Clasen 2014-08-22 02:08:13 UTC
GTK+ is getting this information from the Gtk/CursorThemeName setting.
Comment 4 Robert Roth 2014-10-21 18:18:55 UTC
*** Bug 730869 has been marked as a duplicate of this bug. ***
Comment 5 Pacho Ramos 2015-03-20 19:21:44 UTC
(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
Comment 6 Matthias Clasen 2015-03-20 19:30:58 UTC
See comment 3, XSettings are a way for Desktop environments to export important settings like this one.
Comment 7 Alexandre Rostovtsev 2015-03-22 17:55:20 UTC
(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
Comment 8 Matthias Clasen 2015-03-22 20:36:33 UTC
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.
Comment 9 David Edmundson 2015-03-25 23:21:20 UTC
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?
Comment 10 Matthias Clasen 2015-03-26 02:19:48 UTC
David, thanks thats appreciated!
Comment 11 Jeremy Bicha 2017-06-12 21:28:49 UTC
Is there anything that still needs done for this issue?
Comment 12 Matthias Clasen 2017-06-13 01:13:17 UTC
just testing and verifying that it works
Comment 13 Jeremy Bicha 2017-06-13 01:19:46 UTC
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?
Comment 14 Adrien Jacquet 2017-06-13 04:54:55 UTC
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.
Comment 15 Jeremy Bicha 2017-10-28 22:01:18 UTC
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.