Bug 420859

Summary: Cursor theme/size changes do not take effect for Qt5 and XWayland software until session is restarted
Product: [Plasma] kwin Reporter: Matej Mrenica <matejm98mthw>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: alex765, asturm, blood990, bugseforuns, butirsky, chermnykh2001, dougshaw77, germano.massullo, hujq, Jason, kaabud-kde, kde, kde, lucasgenerates, matejm98mthw, matteo.casarin.37, me, myles.jon.gordon, nate, ombrophile, perso, postix, r.kunschke, rainer, rhysscandle, sam, seqularise, whyhow+tech
Priority: NOR Keywords: wayland
Version: 5.27.11   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=382604
https://bugs.kde.org/show_bug.cgi?id=418936
Latest Commit: Version Fixed In: 6.0 for apps built with Qt6
Sentry Crash Report:

Description Matej Mrenica 2020-05-01 14:55:06 UTC
SOFTWARE/OS VERSIONS 
KDE Frameworks Version: 5.69
Qt Version: 5.15 Beta

ADDITIONAL INFORMATION
...and size settings in cursor settings have no effect on it.
Comment 1 Matej Mrenica 2020-05-02 09:20:03 UTC
Cursor size in Xwayland apps is correct. And cursor size in Gtk3 wayland apps is actually smaller than in Xorg session.
Comment 2 kabud 2020-05-09 05:31:58 UTC
I can reproduce this:
- title bar of discover: normal size 
- inside discover: large 
- title bar and insides of firefox: normal 
- text cursor shaped cursor inside gedit: normal  
- text cursor shaped cursor inside konsole: large

(can't figure out how to make screenshots or screencapture ... kazam doesn't seem to work in wayland)
Comment 3 r.kunschke 2020-06-10 23:50:58 UTC
For me its like the problem is changing all the time depending on what size i set in the settings. The size seems to be different in xwayland, gtk, qt apps and on the titlebars and the desktop too. It changes between the size i set and some bigger one. The cursor size in the settings sometimes have an effect and sometimes not. An relogin seems to change sowthing too.

Arch Linux 
Plasma: 5.19.0
Frameworks: 5.70.0
QT: 5.15
Comment 4 Andreas Sturmlechner 2020-08-10 18:57:24 UTC
Yes, mouse cursor size is all over the place once any kind of scaling is used. Notably, it is much bigger hovering over the desktop surface when compared to in application windows.

(In reply to kabud from comment #2)
> (can't figure out how to make screenshots or screencapture... kazam doesn't
> seem to work in wayland)
Use spectacle.
Comment 5 Andrey 2020-09-17 21:03:41 UTC
(In reply to Matej Mrenica from comment #0)
> ...and size settings in cursor settings have no effect on it.

As a workaround, the size changes after relogin.
Comment 6 Doug 2020-10-15 03:46:18 UTC
I have my cursor set to 24 pt, and my scaling to 150%.

On Firefox:
In the window it is displaying the cursor at 24 pts (properly)
On the title bar it is displaying at 36 pts


On Falcon
In the window it is displaying at 48 pts
On the title bar it is displaying at 36 pts

On the desktop it is displaying at 48 pts
On Latte Dock it is displaying at 48 pts
Comment 7 Matej Mrenica 2020-10-16 16:31:37 UTC
I cannot confirm exact numbers but the comment above describes the situation well. Can someone also confirm the cursor being pixelated everywhere except over SSDs?
Comment 8 David Edmundson 2020-10-27 22:00:10 UTC
Can I see output of  `echo $XCURSOR_SIZE`
Comment 9 Germano Massullo 2020-10-27 22:19:46 UTC
(In reply to David Edmundson from comment #8)
> Can I see output of  `echo $XCURSOR_SIZE`

$ echo $XCURSOR_SIZE
36
Comment 10 Doug 2020-10-30 04:26:15 UTC
(In reply to David Edmundson from comment #8)
> Can I see output of  `echo $XCURSOR_SIZE`

24 for me.
Comment 11 Doug 2020-10-31 04:59:05 UTC
As of last night's updates this problem is resolved for me.
Comment 12 Christoph Feck 2020-11-23 13:10:14 UTC
Matej, can you confirm this cursor issue is fixed with newest software versions?
Comment 13 Matej Mrenica 2020-11-23 15:19:30 UTC
I have tested this issue on KDE Neon unstable from yesterday plus all the updates available as of now (do I need something newer than that?) and this is how it looks like https://imgur.com/a/ZwKXxTK.
Simply said, there is no change. Settings are all default except for fractional scaling at 125% and cursor size 36 (changing the cursor size doesn't make a difference inside a window only on decorations). ~~Also unrelated settings: mouse speed "4" and flat acc. profile.~~
Comment 14 Vlad Zahorodnii 2020-11-25 09:32:19 UTC
@Matej What if you set the cursor size to 24 and reboot the computer? Also, can you reproduce this issue with a scale factor of 1?
Comment 15 Matej Mrenica 2020-11-25 16:12:20 UTC
(In reply to Vlad Zahorodnii from comment #14)
> @Matej What if you set the cursor size to 24 and reboot the computer? Also,
> can you reproduce this issue with a scale factor of 1?

With scale factor of 1 or 100% everything works correctly.

I am testing this with KDE Neon live so I cannot reboot, I do re-login after every change though. The following findings are from KDE Neon but the previous experience was exactly the same as on Arch so I will also test this on Arch later. Someone mentioned there was an update (I am assuming a change in master) but the experience on Neon dev unstable + updates is the same.

Setting a cursor size doesn't have any effect inside Qt apps - the size is always the same inside an app it is only changed over SSDs. For example: if I set it to 24 it is small over SSDs and huge and pixelated/corrupted inside the window. If I set the size to 36 it is bigger (than before) over SSDs and the same (huge) size inside apps. Setting it to 48 produces the same cursor size as "36" (?!) over SSDs and is again exactly the same (huge) inside apps as before.
 
Over gtk apps, there are three different cursor sizes for all three size options (24, 36, 48), however they are all a little bit smaller than over SSDs and all three are pixelated/corrupted. I tested this with Firefox Wayland (not XWayland) and gtk3-demo.
Comment 16 Matej Mrenica 2021-02-11 13:41:17 UTC
*** Bug 418816 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2021-05-14 15:46:40 UTC
Can reproduce on Wayland at 200% scale. After changing the cursor size in the Cursors KCM, it takes effect immediately for when you hover over GTK apps and KWin-drawn SSD titlebars. But the old cursor is still shown when hovering over any Qt software including Plasma and all apps.

Restarting the session is necessary to make the cursor change fully take effect in Qt software too.

Feels like it could be a Qt bug...
Comment 18 Nate Graham 2021-05-14 15:47:43 UTC
When yo apply a new cursor theme or size, it fails to take effect immediately
Comment 19 Nate Graham 2021-05-14 15:48:22 UTC
*** Bug 436303 has been marked as a duplicate of this bug. ***
Comment 20 Nate Graham 2022-01-11 21:44:13 UTC
*** Bug 447198 has been marked as a duplicate of this bug. ***
Comment 21 Vlad Zahorodnii 2022-02-14 14:49:25 UTC
*** Bug 450213 has been marked as a duplicate of this bug. ***
Comment 22 postix 2022-02-15 11:21:42 UTC
*** Bug 368723 has been marked as a duplicate of this bug. ***
Comment 23 Nate Graham 2022-07-18 20:06:42 UTC
*** Bug 456795 has been marked as a duplicate of this bug. ***
Comment 24 Om 2022-12-16 07:43:39 UTC
I just wanted to add that this issue is present in X11 as well, i.e. the updated cursor is used only on GTK apps but not elsewhere until the session is restarted. Hence, it might be helpful if this issue is not interpreted as being specific to wayland.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE neon 5.26
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Graphics Platform: X11
Comment 25 Germano Massullo 2023-06-14 08:46:27 UTC
Confirming on 5.27.5
While having the screen scale at 125%, mouse cursor dimensions 36 and 48 are always shown as huge. The 24 instead is shown as small
Comment 26 Raxelgrande (Pepi) 2023-10-14 14:53:03 UTC
It's still there on 5.27.8

More specifically to me, it happens when im using any of the touhou cursors found in the cursor store (search for touhou and download any of them).
Comment 27 hexchain 2023-12-02 09:07:09 UTC
Also seems to happen in KWin 6 for me.

Operating System: Arch Linux 
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Graphics Platform: Wayland
Comment 28 Vlad Zahorodnii 2023-12-12 21:39:38 UTC
Qt 6 applications react to cursor theme changes. Tested with dolphin and konsole.

Qt 5 don't use the new cursor settings until restarting => CANTFIX

Xwayland apps => depends on the toolkit. If gtk apps don't pick the new cursor settings, perhaps file a bug report for kde-gtk-config. If qt apps don't use the new cursor settings and it also happens in the X11 session, file a bug report to qt developers.
Comment 29 Vlad Zahorodnii 2023-12-12 21:40:51 UTC
Note that you also need to run Plasma 6. Not 5.27!
Comment 30 Germano Massullo 2024-03-25 22:17:25 UTC
I can 100% reproduce the problem also on new system user accounts
plasma-desktop-5.27.11-1.fc39.x86_64

Steps to reproduce:
1) Connect two monitors with different DPIs
2) In system settings, choose "36" as mouse pointer size. My cursors theme is Breeze light
3) logout and login
4) Open a few Gtk and Qt applications, you will see the mouse pointer being 48 size somewhere, and 32 size somewhere else, for example on title bar of various windows
Comment 31 Nate Graham 2024-03-27 16:49:49 UTC
As Vlad mentioned in the comment above yours, this is really only fixable in Plasma 6 for apps using Qt6. Re-closing and changing the fixed-in field.