Bug 459161 - Metabug: Inconsistent cursor size on Wayland
Summary: Metabug: Inconsistent cursor size on Wayland
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR task
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
: 474430 474603 478277 498387 (view as bug list)
Depends on: 435728 448555 451158
Blocks:
  Show dependency treegraph
 
Reported: 2022-09-15 13:39 UTC by Vlad Zahorodnii
Modified: 2025-05-25 07:40 UTC (History)
30 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vlad Zahorodnii 2022-09-15 13:39:17 UTC
Meta bug report to track inconsistent cursor size issues in Plasma Wayland session.

Xcursor themes don't support HIDPI natively, so the compositor and apps multiply cursor size by the scale factor, however they all use different strategies for handling the case when the cursor theme has no requested size, some fallback to the closest cursor size, some fallback to default size 24, etc. This results in inconsistent cursor size when moving the cursor between windows.
Comment 1 Vlad Zahorodnii 2022-09-15 13:39:29 UTC
*** Bug 443661 has been marked as a duplicate of this bug. ***
Comment 2 Vlad Zahorodnii 2022-09-15 13:39:38 UTC
*** Bug 451158 has been marked as a duplicate of this bug. ***
Comment 3 Vlad Zahorodnii 2022-09-15 13:39:48 UTC
*** Bug 459146 has been marked as a duplicate of this bug. ***
Comment 4 Vlad Zahorodnii 2022-09-16 06:45:13 UTC
*** Bug 448555 has been marked as a duplicate of this bug. ***
Comment 5 marchenstar 2022-09-27 00:31:30 UTC
Now after a gtk3 upgrade (possibly from https://gitlab.gnome.org/GNOME/gtk/-/commit/75d3095a6bb0001682be37c6bb4d42e9bb115d39 ). The cursor is 3 times as big on gtk windows compared to rest of the desktop. Using 24 cursor size and 250% global scaling. Following warnings are printed by gtk apps.

(firefox:7952): Gdk-WARNING **: 05:56:17.970: ../gtk/gdk/wayland/gdkcursor-wayland.c:242 cursor image size (64x64) not an integermultiple of scale (3)
Any idea how this can be fixed. It is now hard to use gtk apps with the massive cursor
Comment 6 Jin Liu 2023-01-08 00:46:41 UTC
(In reply to nocturne from comment #5)
> Now after a gtk3 upgrade (possibly from
> https://gitlab.gnome.org/GNOME/gtk/-/commit/
> 75d3095a6bb0001682be37c6bb4d42e9bb115d39 ). The cursor is 3 times as big on
> gtk windows compared to rest of the desktop. Using 24 cursor size and 250%
> global scaling. Following warnings are printed by gtk apps.
> 
> (firefox:7952): Gdk-WARNING **: 05:56:17.970:
> ../gtk/gdk/wayland/gdkcursor-wayland.c:242 cursor image size (64x64) not an
> integermultiple of scale (3)
> Any idea how this can be fixed. It is now hard to use gtk apps with the
> massive cursor

It can be fixed by manually editing ~/.config/gtk-3.0/settings.ini and change the line:
    gtk-cursor-theme-size=24
to
    gtk-cursor-theme-size=8
Comment 7 David Edmundson 2023-01-17 13:45:56 UTC
*** Bug 435728 has been marked as a duplicate of this bug. ***
Comment 8 Jakub 2023-07-10 17:10:50 UTC
*** Bug 471001 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2023-07-25 21:12:56 UTC
I use 36px Breeze cursors at 200% scale. I have rebooted after changing the size from 24px to 36px.

~/.config/gtk-3.0/settings.ini and ~/.config/gtk-4.0/settings.ini both say `gtk-cursor-theme-size=36`

~/.config/kcminputrc says `cursorSize=36`

Here's what I see:
- Over KWin-drawn titlebars, the cursor is 36px
- Over Plasma and KDE apps, the cursor is 48px
- Over GTK apps, the cursor is 24px

It's a bit of a mess. :)
Comment 11 Vlad Zahorodnii 2023-12-14 12:35:19 UTC
*** Bug 474430 has been marked as a duplicate of this bug. ***
Comment 12 postix 2024-11-27 17:47:25 UTC
There has been a GTK4 bug, which caused cursor sizes to be too big under Plasma Wayland
* https://gitlab.gnome.org/GNOME/gtk/-/issues/7031

However, the fixe(s)
* https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7760

won't be backported to the Gtk 4.16 stable branch as of 
* https://gitlab.gnome.org/GNOME/gtk/-/issues/7031#note_2234757
> They rely on viewporter support for pointer surfaces, and mutter still does not support that
Comment 13 postix 2024-11-27 17:56:08 UTC
^ https://gitlab.gnome.org/GNOME/mutter/-/issues/2633
> Support wp_viewport for cursor surfaces
Comment 14 postix 2024-11-27 18:34:56 UTC
*** Bug 474603 has been marked as a duplicate of this bug. ***
Comment 15 postix 2024-11-27 18:35:02 UTC
*** Bug 478277 has been marked as a duplicate of this bug. ***
Comment 16 fanzhuyifan 2025-01-12 20:21:19 UTC
*** Bug 498387 has been marked as a duplicate of this bug. ***
Comment 17 Ellie 2025-01-12 20:42:03 UTC
Sorry if this is the wrong place to point this out, but it seems like cursor sizes can also differ on the plasma taskbar itself for the same plasma version if you change themes and DPI scale in the "wrong" order, see #498387 .
Comment 18 Noah Westervelt 2025-01-16 02:49:19 UTC
I think my issue is related to this bug, so I'll put this here instead of creating a new bug report:

I have an xcursor theme of size 32px x 32px (only size available) and the size of the cursor matches that when my cursor hovers over windows running under XWayland (ex. VLC) or GTK windows (ex. Firefox) but is a smaller size in all other cases. Those other cases include hovering over the titlebar of windows, the plasma desktop (background / plasma panel), and native Wayland apps not using GTK.

I'm using Plasma 6.2.4 with Wayland and below is the specific cursor theme in use:
https://store.kde.org/p/1914275/