Bug 459468 - Certain Xwayland apps do not respect third-party cursor theme on Wayland
Summary: Certain Xwayland apps do not respect third-party cursor theme on Wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 454959 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-09-21 02:03 UTC by Patrick Silva
Modified: 2024-03-01 02:49 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.6
Sentry Crash Report:


Attachments
Sample C code exhibiting the issue (1.89 KB, text/x-csrc)
2022-11-16 18:43 UTC, Luca Bacci
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2022-09-21 02:03:58 UTC
SUMMARY
i use 'Future Cursors' cursor theme, it is not respected by the following Xwayland apps:
Thunderbird (flatpak)
Tixati torrent client (gtk2)
jdownloader (java)
BiglyBT torrent client (java)

Other Xwayland apps like Discord and VLC player respect the same cursor theme.


STEPS TO REPRODUCE
1. use Wayland session
2. install and apply a third-party cursor theme in Cursors KCM
3. run any affected app mentioned above

OBSERVED RESULT
explained above

EXPECTED RESULT
all apps should respect a third-party cursor theme on Wayland

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Graphics Platform: Wayland
Comment 1 Nate Graham 2022-09-22 19:50:17 UTC
Does it work after you reboot? If so, this is Bug 420859.
Comment 2 Patrick Silva 2022-09-22 20:29:55 UTC
The bug persists after reboot.
Comment 3 Bug Janitor Service 2022-10-07 04:51:30 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Patrick Silva 2022-10-07 10:50:04 UTC
The requested info was provided.
Comment 5 Luca Bacci 2022-11-16 17:51:40 UTC
Hi, I'm having the same issue on Plasma 5.26.3. Blender and GTK2 apps are affected. Also GTK3/4 apps when forcing the x11 backend by setting GDK_BACKEND=x11.

GTK uses XIDefineCursor if XInput2 is available and falls back to XDefineCursor in the other case. Anyway I'll try setting up a python-xlib sample reproducing the issue.

As Patrick pointed out, that's probably a different issue than https://bugs.kde.org/show_bug.cgi?id=420859 because the cursor is not correct even after rebooting
Comment 6 Luca Bacci 2022-11-16 18:43:59 UTC
Created attachment 153813 [details]
Sample C code exhibiting the issue

Attached sample C code exhibiting the issue. Should I open an issue in KWin GitLab?
Comment 7 Nate Graham 2022-11-16 19:07:29 UTC
Maybe just submit a merge request to fix it! :D
Comment 8 Luca Bacci 2022-11-20 08:50:32 UTC
On X11, windows which do not have any cursor set default to the cursor of the parent. For toplevel windows, that means the cursor of the root window. That issue is actually a duplicate of https://bugs.kde.org/show_bug.cgi?id=442839; there Vlad Zahorodnii explains in detail why the root window has the Adwaita cursor theme.
Comment 9 gudvinr+kde 2022-11-21 14:16:50 UTC
I am not sure if it is same issue but wxgtk app prusaslicer also has this issue. I believe it uses GTK3 internally.
But it definitely runs inside xwayland and not as native wayland app because backend is hardcoded in the app.
Comment 10 Luca Bacci 2022-11-23 15:13:27 UTC
Yep, it's that issue :) I hope I can make a fix for that soon ;)
Comment 11 Bug Janitor Service 2022-11-24 20:47:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3239
Comment 12 Vlad Zahorodnii 2023-01-06 11:07:19 UTC
*** Bug 442839 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2023-01-06 14:20:51 UTC
*** Bug 454959 has been marked as a duplicate of this bug. ***
Comment 14 Andres 2023-04-08 23:09:59 UTC
I think I am also running into this [issue] (https://forum.garudalinux.org/t/gtk-plasma-theme-not-being-applied-on-wayland/27801/6) ? For me GTK apps do not use the theme specified in System Settings -> Apperance -> Application Style - > GTK application Style or my cursor theme; instead, using the default, Adwaita


```
Operating System: Garuda Linux 
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.2.10-273-tkg-bmq (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6700 XT
```
Comment 15 Bug Janitor Service 2023-06-09 17:26:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4165
Comment 16 Vlad Zahorodnii 2023-06-14 14:02:04 UTC
Git commit dc4c463ca36b26ceb25efda7fa25a7c7a906002d by Vlad Zahorodnii, on behalf of Severin von Wnuck.
Committed on 14/06/2023 at 13:37.
Pushed by vladz into branch 'master'.

xwayland: Remove cursor definition

This is now handled by krdb.
Related: bug 442839

M  +0    -6    src/xwayland/xwayland.cpp

https://invent.kde.org/plasma/kwin/-/commit/dc4c463ca36b26ceb25efda7fa25a7c7a906002d
Comment 17 Vlad Zahorodnii 2023-06-14 14:50:44 UTC
Git commit fb238b25d126df6f1b7a48ddbdef10b7cc572f60 by Vlad Zahorodnii, on behalf of Severin von Wnuck.
Committed on 14/06/2023 at 14:06.
Pushed by vladz into branch 'Plasma/5.27'.

xwayland: Remove cursor definition

This is now handled by krdb.
Related: bug 442839


(cherry picked from commit dc4c463ca36b26ceb25efda7fa25a7c7a906002d)

M  +0    -6    src/xwayland/xwayland.cpp

https://invent.kde.org/plasma/kwin/-/commit/fb238b25d126df6f1b7a48ddbdef10b7cc572f60
Comment 18 Andres 2023-06-20 23:25:23 UTC
Is this supossed to be fixed on  5.27.6? I am still encountering the issue

Operating System: Garuda Linux 
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10
Kernel Version: 6.3.8-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6700 XT
Comment 19 David 2023-06-21 03:12:40 UTC
I'm still encountering this in spotify and some other apps

```
Operating System: Arch Linux 
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10
Kernel Version: 6.3.8-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 20 Naxdy 2023-06-27 18:07:00 UTC
It's fixed for me in Gentoo, but not on my NixOS install. My wife on Fedora is also still experiencing this issue. Makes me think there is some patch in the Gentoo repos that helps with this... Thoughts ?
Comment 21 Patrick Silva 2023-06-27 18:39:04 UTC
it's also fixed for me on Arch Linux.
Comment 22 Naxdy 2023-06-27 18:44:39 UTC
This then suggests that it may be config / environment related (I use the same home folder on my NixOS and Gentoo installs, but observe different behavior). Unfortunately, I've tinkered a LOT when it comes to cursors, but I will try to see if I can dig up some relevant configs.
Comment 23 Naxdy 2023-07-08 11:00:25 UTC
Quick update: After some deliberation I've found that the apps that still had the adwaita cursor theme on my Nix install were all flatpak apps that didn't have proper read permissions for the ~/.icons folder. Granting them permissions solved the issue.

I'm going to go ahead and close this for now, feel free to reopen if anyone has an issue with a non-flatpak app, or a flatpak app that does have the proper permissions set.
Comment 24 Andres 2023-07-09 01:23:50 UTC
This still affects me with non flatpak applications such as Vivaldi and lutris
Comment 25 Naxdy 2023-07-20 05:46:05 UTC
@Andres did you confirm that the flatpak apps in question have read access to ~/.icons and/or /usr/share/icons (or wherever your cursor theme is located), and that their XCursor search path isn't being overwritten using an environment variable?

You can use Flatseal to check this, or KDE's built-in permissions system in System Settings -> Applications -> Flatpak Permission Settings
Comment 26 Andres 2023-07-23 18:34:53 UTC
Like I said in the above reply, this is affecting me on NON-flatpaked apps such as Vivaldi and Lutris which is installed via my package manager (Pacman)
Comment 27 Patrick Silva 2023-09-15 17:56:51 UTC
On my system, Vivaldi browser 6.2.3105.48 running natively on Wayland uses Adwaita mouse pointer.
However, Vivaldi running on Xwayland uses Breeze mouse pointer as expected. The same with Chromium.

Operating System: Arch Linux 
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Graphics Platform: Wayland
Comment 28 tani.giovonni 2023-12-24 11:40:16 UTC
I am also getting this issue on non-flatpaked apps. (Garuda) Annoyingly I swear I remember I found a fix before, but my drive got corrupted to hell because my memory started going out and I don't remember what the fix was exactly.
Comment 29 Patrick Silva 2024-02-29 15:18:36 UTC
Now Chromium 122 and other browsers based on it respects the mouse cursor theme. Currently Blender from Arch repos is the only app that does not respect the mouse cursor theme on my system. But it runs natively on Wayland and this bug report is about Xwayland apps. I'm going to close this report as fixed.

Operating System: Arch Linux 
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Graphics Platform: Wayland
Comment 30 Nate Graham 2024-03-01 02:49:02 UTC
Hooray!