You are not logged in.

#1 2024-09-21 18:13:22

HurricanePootis
Member
Registered: 2020-10-16
Posts: 22

GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

As of recently, whenever I use a GTK4 app on KDE Wayland, the mouse cursor is huge whenever hovering the app window. Regardless if whether I am set to 125%, 150%, or 200% scaling in the KDE Display settings, the following error is printed out by the app:

(helvum:31475): Gdk-WARNING **: 13:09:27.565: ../gtk/gdk/wayland/gdkcursor-wayland.c:210 cursor image size (64) not an integer multiple of theme size (24)

It's really jarring and ugly to have a huge cursor jump into existence whenever I want to use a GTK 4 app. Has anyone else been having this issue, and is this a known issue as well? I appreciate all the help, thanks.

Edit:
Here is my ~/.config/gtk-4.0/settings.ini

[Settings]
gtk-application-prefer-dark-theme=true
gtk-cursor-theme-name=breeze_cursors
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-font-name=Noto Sans,  10
gtk-icon-theme-name=Papirus-Dark
gtk-primary-button-warps-slider=true
gtk-sound-theme-name=ocean
gtk-xft-dpi=122880

Last edited by HurricanePootis (2024-09-21 18:14:23)

Offline

#2 2024-09-21 23:32:28

acubens
Member
Registered: 2024-06-14
Posts: 7

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

Same problem for me, celluloid and pavucontrol on Sway have a huge cursor 16.gif

$ swaymsg -t get_outputs | grep -i scale
    "scale": 1.5,
    "scale_filter": "linear",
$ echo $XCURSOR_SIZE
28
$ gsettings get org.gnome.desktop.interface cursor-size
28
$ journalctl --user | grep celluloid | tail -n1
set 22 01:35:12 arch celluloid[3258]: ../gtk/gdk/wayland/gdkcursor-wayland.c:210 cursor image size (48) not an integer multiple of theme size (28)

Last edited by acubens (2024-09-21 23:41:17)

Offline

#3 2024-09-22 15:20:46

Roger Sheaffe
Member
Registered: 2024-09-19
Posts: 5

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

Yes, this started happening to me a few days ago after an update to gtk3 and gtk4, along with some other packages that I think were related to those. I tried changing the settings.ini cursor size for gtk3and4 but that didn't do anything. I tried downloading xdg-desktop-portal-gtk but that also didn't work. Then I tried resetting the gtk application theme in KDE system settings without any change.

Offline

#4 2024-09-23 03:00:16

raydredondo
Member
Registered: 2024-09-23
Posts: 1

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

Also having issues with this. Anyone know where to start looking?

Offline

#5 2024-09-23 14:01:33

HurricanePootis
Member
Registered: 2020-10-16
Posts: 22

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

Maybe we have to make an issue on GTK's gitlab?

Offline

#6 2024-09-23 14:09:20

HurricanePootis
Member
Registered: 2020-10-16
Posts: 22

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

I found a pull request here

Offline

#7 2024-09-28 02:15:14

genericity
Member
Registered: 2014-09-20
Posts: 32

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

It's a GTK4 bug. There are 3 workarounds:

1. Apply the patch in https://gitlab.gnome.org/GNOME/gtk/-/me … uests/7722 (Upper right corner, Code - Download Patch) and build your own GTK4.

2. Use other cursor themes than Breeze. E.g.  Adwaita.

3. Build your own Breeze cursor theme:

3.1 Install `inkscape` and `xorg-xcursorgen`
3.1 `git clone https://github.com/kde/breeze`
3.2 Edit `breeze/cursors/src/build.sh`, change `NOMINAL_SIZE=24` to `NOMINAL_SIZE=32`.
3.3. `cd breeze/cursors/Breeze; ../src/build.sh; cp -r Breeze ~/.local/share/icons/breeze_cursors`
3.4. In SystemSettings - Cursor Theme, choose a new cursor size.

EDIT: GTK merged a different fix in https://gitlab.gnome.org/GNOME/gtk/-/me … uests/7749 and https://gitlab.gnome.org/GNOME/gtk/-/me … uests/7760 . But it won't work with Mutter at the moment. You can build that commit if you only use GTK apps in KDE. My original patch in point 1 should work with both GNOME and KDE.

Last edited by genericity (2024-09-29 02:15:24)

Offline

#8 2024-09-29 22:12:18

acubens
Member
Registered: 2024-06-14
Posts: 7

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

genericity wrote:

2. Use other cursor themes than Breeze. E.g.  Adwaita.

I have this problem with the Capitaine-Cursors and Nordic-Cursors themes.
Now I'm temporarily using Breezex-lights theme and works properly. asd2.gif

Offline

#9 2024-09-30 01:13:07

genericity
Member
Registered: 2014-09-20
Posts: 32

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

acubens wrote:

I have this problem with the Capitaine-Cursors and Nordic-Cursors themes.
Now I'm temporarily using Breezex-lights theme and works properly. https://www.forumforyou.it/faccine/smile8/asd2.gif

It happens to quite a lot of themes that use the same build script as Breeze. The "NOMINAL_SIZE=32 and rebuild" trick in point 3 works for them too.

Offline

#10 2024-10-04 19:24:46

Roger Sheaffe
Member
Registered: 2024-09-19
Posts: 5

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

genericity wrote:

EDIT: GTK merged a different fix in https://gitlab.gnome.org/GNOME/gtk/-/me … uests/7749 and https://gitlab.gnome.org/GNOME/gtk/-/me … uests/7760 . But it won't work with Mutter at the moment. You can build that commit if you only use GTK apps in KDE. My original patch in point 1 should work with both GNOME and KDE.

Does this mean one of these days Im going to get a GTK4 package update and it will fix itself?

Offline

#11 2024-10-05 01:30:57

genericity
Member
Registered: 2014-09-20
Posts: 32

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

Roger Sheaffe wrote:
genericity wrote:

EDIT: GTK merged a different fix in https://gitlab.gnome.org/GNOME/gtk/-/me … uests/7749 and https://gitlab.gnome.org/GNOME/gtk/-/me … uests/7760 . But it won't work with Mutter at the moment. You can build that commit if you only use GTK apps in KDE. My original patch in point 1 should work with both GNOME and KDE.

Does this mean one of these days Im going to get a GTK4 package update and it will fix itself?

Yes. It will be fixed in GTK 4.18, due Mar 2025.

Offline

#12 Yesterday 22:56:32

hyprlande
Member
Registered: Yesterday
Posts: 1

Re: GTK 4 Apps Using Cursor Size of 64 On Any KDE Wayland HiDPI Scaling

Found a much easier fix on manjaro forums. Enter this command in terminal:
dconf write /org/gnome/desktop/interface/cursor-size 32

Offline

Board footer

Powered by FluxBB