Summary: | gui-libs/gtk-4 doesn't look for /usr/share/cursors/xorg-x11/ path in wayland | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Johannes Penßel <johannesp> |
Component: | Current packages | Assignee: | Gentoo Linux Gnome Desktop Team <gnome> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | bitlord0xff, leio, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gdk/wayland/gdkdisplay-wayland.c#L995 | ||
See Also: |
https://gitlab.gnome.org/GNOME/gtk/-/issues/4924 https://bugs.gentoo.org/show_bug.cgi?id=850445 https://bugs.gentoo.org/show_bug.cgi?id=926866 https://bugs.gentoo.org/show_bug.cgi?id=934161 https://bugs.gentoo.org/show_bug.cgi?id=834001 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 834277 | ||
Bug Blocks: | |||
Attachments: |
emerge --info, gtk4-query-settings, printenv
journalctl output |
Created attachment 770861 [details]
journalctl output
For testing purposes, I set up a completely new installation based on the stage3-systemd-desktop tarball, onto which I installed only wayfire and gnome-calculator as test bunny. On this setup, the issue did NOT occur. It also wasn't present after enabling ~amd64 and performing a full system upgrade. When I switched over to the systemd/gnome profile and rebuilt again, the problem was back. Something that's pulled in by the gnome profile seems to break GTK4. Disregard the above. Looks like I initially forgot to set the wayland USE-flag on gui-libs/gtk. with it enabled, the cursor problem occurs even without the gnome profile. I am pretty sure I figured it out now. Looks like x11-themes/adwaita-icon-theme installs cursor icons into /usr/share/cursors/xorg-x11/Adwaita/cursors. Apparently, GTK4 is unable to pick them up in this location on wayland and thus falls back to a 32x32 image cursor. This is made evident by the GTK4-Demos cursor demo, where all cursors work normally, except for the one that is supposed to show the current default and just displays the 32x32 fallback image cursor. After copying /usr/share/cursors/xorg-x11/Adwaita/cursors into /usr/share/icons/Adwaita, all cursors are working flawlessly now. (In reply to Johannes P from comment #4) > I am pretty sure I figured it out now. Looks like > x11-themes/adwaita-icon-theme installs cursor icons into > /usr/share/cursors/xorg-x11/Adwaita/cursors. Apparently, GTK4 is unable to > pick them up in this location on wayland and thus falls back to a 32x32 > image cursor. > This is made evident by the GTK4-Demos cursor demo, where all cursors work > normally, except for the one that is supposed to show the current default > and just displays the 32x32 fallback image cursor. > After copying /usr/share/cursors/xorg-x11/Adwaita/cursors into > /usr/share/icons/Adwaita, all cursors are working flawlessly now. Thanks for the workaround, helps a lot (cursors are sized properly and change depending on the "content" so applications are usable again, and it's easy to resize them (at least in Gnome)) For now I just created a symlink and it works! ;-) It seems this affects to all the cursor packs in Gentoo as we use /usr/share/cursors instead of /usr/share/icons... and it seems that is not common in other distributions: https://github.com/flatpak/flatpak/issues/709#issuecomment-703239940 But, then, either we would need to carry a patch to add that location in Gentoo (probably forever as I am unsure if upstream would accept it) or also fix many other cursor packs in the tree that are using our "non-standard" location Other option (for the case we keep the traditional Gentoo location for the cursors) would be to at least add a symlink I tried to cover this (and other bugs) in the ebuild posted at https://bugs.gentoo.org/844910#c4 The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a95901e1a1b5dfe049b65b24933bcbefb65acc9 commit 3a95901e1a1b5dfe049b65b24933bcbefb65acc9 Author: Pacho Ramos <pacho@gentoo.org> AuthorDate: 2022-05-27 21:12:21 +0000 Commit: Pacho Ramos <pacho@gentoo.org> CommitDate: 2022-05-27 21:20:04 +0000 x11-themes/adwaita-icon-theme: Package legacy icons and fix cursors path adwaita-icon-them dropped many legacy icons breaking many different applications. We were waiting for pieces to get fixed but, for now, it has turned into never ending disputed among different upstreams and breakage being kept for Gnome 42 cycle affecting many different apps. We follow Debian for now until this is better solved in the future in one way on another. Also keep upstream default location for cursor themes. Gentoo location is kept for backwards compatibility but that location is highly Gentoo specific. As a consequence, upstreams keep breaking in several ways and not fixing their apps to honour our PATH. Bug: https://bugs.gentoo.org/834277 Bug: https://bugs.gentoo.org/834001 Bug: https://bugs.gentoo.org/838451 Bug: https://bugs.gentoo.org/844910 Signed-off-by: Pacho Ramos <pacho@gentoo.org> x11-themes/adwaita-icon-theme/Manifest | 2 + .../adwaita-icon-theme-42.0_p2.ebuild | 97 ++++++++++++++++++++++ 2 files changed, 99 insertions(+) I found a workaround for this issue. Both gtk 3 and gtk 4 read cursor theme from gsettings. import-gtk3-settings-into-gsettings ``` #!/bin/sh # usage: import-gsettings config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" if [ ! -f "$config" ]; then exit 1; fi gnome_schema="org.gnome.desktop.interface" #gtk_theme="$(grep 'gtk-theme-name' "$config" | cut -d'=' -f2)" #icon_theme="$(grep 'gtk-icon-theme-name' "$config" | cut -d'=' -f2)" cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | cut -d'=' -f2)" #font_name="$(grep 'gtk-font-name' "$config" | cut -d'=' -f2)" #gsettings set "$gnome_schema" gtk-theme "$gtk_theme" #gsettings set "$gnome_schema" icon-theme "$icon_theme" gsettings set "$gnome_schema" cursor-theme "$cursor_theme" #gsettings set "$gnome_schema" font-name "$font_name" ``` This script is sufficient for setting cursor theme for both gtk 3 and gtk 4. In the absence of gsettings and Settings d-bus portal, ~/.config/gtk-3.0 and ~/.config/gtk-4.0 will be consulted. Because gtk 4 does not look up cursors in /usr/share/cursors/xorg-x11, I had to execute ``` ln -s /usr/share/cursors/x11-xorg ~/.local/share/icons ``` or ``` ln -s /usr/share/cursors/x11-xorg ~/.icons ``` With this, gtk 4 now uses the same cursor theme as gtk 3. I think cursor packages should create symlinks from /usr/share/cursors/x11-xorg/THEME to /usr/share/icons/THEME. We should fix all our cursor packages to install in the right place, not a xorg-x11 location, but no-one seems to have pushed for that yet? Saying this as I was contemplating of why the cursors location patch in gnome-tweaks was dropped and was about to bring it back as it seemed to find more cursors that I installed that only go to xorg-x11, but fortunately found this bug first and found that it'd be broken for gtk4, thus we should indeed not advertise xorg-x11 path cursors in gnome-tweaks as-is. |
Created attachment 770858 [details] emerge --info, gtk4-query-settings, printenv Probably the same as #836810 wich was assumed to be a system-specific issue rather than a bug and closed. In GTK4 windows on Wayland, the mouse cursor becomes twice as big (roughly "medium" size in GNOME's accessibility settings) and does not change in shape anymore. It also disregards any configuration. I have observed this behaviour on two different machines, both running full ~amd64 and systemd, one with intel and the other with binary nvidia drivers. It happens on other Wayland-based WMs as well. (tested on the intel system for sanity) Use cases that are NOT affected: 1. GTK4 apps on X11 2. GTK4-based flatpaks on Wayland A quick test with Arch Linux shows that the issue does not occur there either. Things I have tried so far: 1. changing cursor size in gnome-control-center 2. declaring gtk-cursor-theme-size = 24 in /etc/gtk-4.0/settings.ini as well as ~/.config/gtk-4.0/settings.ini 3. changing cursor size in gsettings via $ dconf write /org/gnome/desktop/interface/cursor-size 24 (normal and root) 4. exporting XCURSOR_SIZE=24 as environment variable in /etc/environment