Bug 480792 - some applications ignore the cursor size and theme on wayland
Summary: some applications ignore the cursor size and theme on wayland
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.93.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-03 18:13 UTC by Ravi
Modified: 2024-02-08 08:00 UTC (History)
2 users (show)

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


Attachments
xsettingsd.conf (389 bytes, text/plain)
2024-02-05 17:15 UTC, Ravi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ravi 2024-02-03 18:13:34 UTC
SUMMARY
On wayland, some gtk applications like chrome or vivaldi ignore the cursor theme and size

STEPS TO REPRODUCE
1.  Log into plasma using wayland
2.  Set breeze light as cursor theme and size of 24 
3.  Open google chrome

OBSERVED RESULT
Mouse inside chrome will use the default style (breeze) and very small size (maybe 12?)
This also happens if the cursor was set on the previous session

EXPECTED RESULT
Mouse cursor should be the same style/size as in plasma

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Linux 6.6.13-gentoo / Plasma 5.93.0
KDE Plasma Version:  5.93.0
KDE Frameworks Version:  5.249.0
Qt Version: 6.6.1

ADDITIONAL INFORMATION
I'm using two monitors, main one on the right, nvidia drivers, and global scaling of 125%
Comment 1 Doug 2024-02-05 05:25:23 UTC
I cannot reproduce.

Operating System: KDE neon Testing Edition
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.1
Kernel Version: 6.5.0-15-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz
Memory: 15.4 GiB of RAM
Graphics Processor: AMD Radeon Pro WX 3200 Series
Manufacturer: Dell Inc.
Product Name: Precision 7540
Comment 2 Bug Janitor Service 2024-02-05 10:52:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5103
Comment 3 Vlad Zahorodnii 2024-02-05 10:53:31 UTC
I cannot reproduce the issue but there are seems to be issues with xwayland apps reacting to new scale values, this might be the culprit.
Comment 4 Vlad Zahorodnii 2024-02-05 11:00:44 UTC
Can you run `xrdb -query`?
Comment 5 Vlad Zahorodnii 2024-02-05 11:15:27 UTC
Also can you attach your .config/xsettingsd/xsettingsd.conf to this bug report please?
Comment 6 Ravi 2024-02-05 17:14:14 UTC
(In reply to Vlad Zahorodnii from comment #4)
> Can you run `xrdb -query`?

➜ xrdb -query
Xcursor.size:   30
Xcursor.theme:  Breeze_Light
Xft.antialias:  1
Xft.dpi:        120
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:       rgb
Comment 7 Ravi 2024-02-05 17:15:35 UTC
Created attachment 165574 [details]
xsettingsd.conf
Comment 8 Vlad Zahorodnii 2024-02-05 17:16:10 UTC
Git commit 63c1363ca1a9077a804975ab3670c68aa233e0b6 by Vlad Zahorodnii.
Committed on 05/02/2024 at 16:51.
Pushed by vladz into branch 'master'.

Fix syncing Xwayland::Scale config option

The new scale value is written but it's not flushed to the disk so
when kcm_fonts_init and kcm_style_init run, they use the old scale
value.

M  +9    -5    src/main.cpp

https://invent.kde.org/plasma/kwin/-/commit/63c1363ca1a9077a804975ab3670c68aa233e0b6
Comment 9 Bug Janitor Service 2024-02-05 17:17:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5111
Comment 10 Ravi 2024-02-05 17:17:58 UTC
(In reply to Vlad Zahorodnii from comment #3)
> I cannot reproduce the issue but there are seems to be issues with xwayland
> apps reacting to new scale values, this might be the culprit.

Could be. I don't know if this would also affect font sizes, but the font-sizes look normal on chrome
Comment 11 Vlad Zahorodnii 2024-02-05 17:27:41 UTC
Git commit e658d5ee02cbe1de37d3525ebff73c41e0e7a076 by Vlad Zahorodnii.
Committed on 05/02/2024 at 17:16.
Pushed by vladz into branch 'Plasma/6.0'.

Fix syncing Xwayland::Scale config option

The new scale value is written but it's not flushed to the disk so
when kcm_fonts_init and kcm_style_init run, they use the old scale
value.


(cherry picked from commit 63c1363ca1a9077a804975ab3670c68aa233e0b6)

M  +9    -5    src/main.cpp

https://invent.kde.org/plasma/kwin/-/commit/e658d5ee02cbe1de37d3525ebff73c41e0e7a076
Comment 12 Ravi 2024-02-05 19:02:26 UTC
I saw that the merge request has already been merged. That was fast!
I'll try to build plasma from master this week and see if this fixes it
Comment 13 Ravi 2024-02-05 23:12:37 UTC
I built plasma from git today, but unfortunately this did not fix it. If I apply an even greater scaling (like 150%), the text will appear even bigger, but the mouse cursor stays the same
Comment 14 Vlad Zahorodnii 2024-02-06 08:49:11 UTC
Are only chromium-based web browsers affected?
Comment 15 Vlad Zahorodnii 2024-02-06 08:54:44 UTC
Do you also use flatpak or do you run chrome in a sandbox environment?
Comment 16 Ravi 2024-02-06 14:03:19 UTC
no flatpaks or sandboxed apps.

the wrong theme + wrong size only seems to happen with chromium-based apps. If I change the scaling back to 100%, they will use the correct size, but wrong theme as well.

I tested some other applications, and got the wrong cursor theme, but correct size. It seems to affect only qt5 applications. Some examples:
git cola
openscad
pavucontrol-qt
strawberry
qterminal

This also only happens on wayland

I hope this helps!
Comment 17 Nate Graham 2024-02-06 17:51:58 UTC
Might the issue in Chromium and Electron-based apps be fixed by https://chromium-review.googlesource.com/c/chromium/src/+/5196950?
Comment 18 Vlad Zahorodnii 2024-02-07 12:50:52 UTC
Try building qt5 version of plasma-integration if you don't have it. But other than that, nothing makes sense about this bug report, not sure that it's actionable.
Comment 19 Vlad Zahorodnii 2024-02-07 12:54:14 UTC
Given that it's gentoo, make sure that it's not a setup issue.
Comment 20 Ravi 2024-02-07 13:51:13 UTC
You're right! There was a setup issue, plasma integration wasn't built with qt5 support. I built it and that fixed the issue with the qt5 applications, but not with chrome. I'll try building a recent enough version of chrome today, and I'll let you know if it solves it.
But the weird thing is that on plasma 5.27 on wayland I didn't have that problem on chrome
Comment 21 Vlad Zahorodnii 2024-02-07 14:11:21 UTC
Okay, great. As for chrome, I think it's connected to us not setting XCURSOR_THEME and XCURSOR_SIZE environment variables anymore. This issue should be resolved by itself later after updating to chromium that supports the cursor shape protocol.
Comment 22 Ravi 2024-02-08 08:00:47 UTC
Can confirm: latest version of chrome doesn't have that problem. Thanks!