Bug 466094 - Incorrect cursor rendering with screen scaling enabled
Summary: Incorrect cursor rendering with screen scaling enabled
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 465167 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-02-19 16:17 UTC by neatnoise
Modified: 2023-02-24 01:02 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.2


Attachments
cursor glitch (238.79 KB, image/png)
2023-02-19 16:17 UTC, neatnoise
Details

Note You need to log in before you can comment on or make changes to this bug.
Description neatnoise 2023-02-19 16:17:37 UTC
Created attachment 156501 [details]
cursor glitch

SUMMARY
***
Incorrect cursor rendering with screen scaling enabled. The mouse cursor is rendered with the half/part of the icon and incorrect position. The visibility of incorrect cursor depends on the focused window application, on some is visible more, on other less. The resolution I use is 1920x1080 with 150% scaling enabled, KDE wayland platform Plasma 5.27, latest updates in Arch Linux, software cursor rendering set via variable.
***


STEPS TO REPRODUCE
1. Set wayland desktop, set resolution 1920x1080 with scaling 150% (it might be also case in other resolutions/scaling options), set software cursor rendering via env variable
2. Focus mouse cursor on the app (discord for example)

OBSERVED RESULT
Part of cursor icon rendered on focused application

EXPECTED RESULT
Normal cursor rendered without glitches

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma wayland on Arch Linux
KDE Plasma Version: 5.27
KDE Frameworks Version: 5.103.0-1
Qt Version: 6.4.2

ADDITIONAL INFORMATION
Cursor software rendering enabled via variable
Comment 1 neatnoise 2023-02-20 10:45:39 UTC
GPU: AMD Radeon RX 580
Mesa: 22.3.5
OpenGL renderer string: AMD Radeon RX 580 Series (polaris10, LLVM 15.0.7, DRM 3.49, 6.1.12-arch1-1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.3.5
Comment 2 Zamundaaa 2023-02-20 15:22:11 UTC
Can confirm. With "apply scaling themselves" and a software cursor, I don't just see the glitches you see but also wrong damage tracking
Comment 3 Bug Janitor Service 2023-02-20 17:59:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3642
Comment 4 Zamundaaa 2023-02-20 19:26:01 UTC
Git commit 81571203f12c3fbd8c7cb8bc6446587a43d3895b by Xaver Hugl.
Committed on 20/02/2023 at 18:50.
Pushed by zamundaaa into branch 'master'.

cursorsource: fix scaling with Xwayland

Before this commit, the device pixel ratio of the cursor was set to ignore
the Xwayland scale override, while the size of the cursor surface was scaled.
This change removes the scaling of the cursor surface size, to make the cursor
be no longer cut off in rendering.

M  +6    -1    src/cursorsource.cpp

https://invent.kde.org/plasma/kwin/commit/81571203f12c3fbd8c7cb8bc6446587a43d3895b
Comment 5 Zamundaaa 2023-02-20 19:49:29 UTC
Git commit e2a082594a8561a7228cfe2d6cf8020fd4c85b6a by Xaver Hugl.
Committed on 20/02/2023 at 19:32.
Pushed by zamundaaa into branch 'Plasma/5.27'.

cursorsource: fix scaling with Xwayland

Before this commit, the device pixel ratio of the cursor was set to ignore
the Xwayland scale override, while the size of the cursor surface was scaled.
This change removes the scaling of the cursor surface size, to make the cursor
be no longer cut off in rendering.


(cherry picked from commit 81571203f12c3fbd8c7cb8bc6446587a43d3895b)

M  +6    -1    src/cursorsource.cpp

https://invent.kde.org/plasma/kwin/commit/e2a082594a8561a7228cfe2d6cf8020fd4c85b6a
Comment 6 Zamundaaa 2023-02-20 21:54:32 UTC
Git commit 4cd25cf571d5a350b5e62e612a990bfdfa934bff by Xaver Hugl.
Committed on 20/02/2023 at 21:01.
Pushed by zamundaaa into branch 'master'.

cursor: make position, hotspot and size floating point

This allows all pixel positions to be used on high dpi screens,
and corrects damage tracking with Xwayland cursors

M  +2    -2    autotests/integration/move_resize_window_test.cpp
M  +2    -2    autotests/integration/pointer_input.cpp
M  +13   -13   autotests/integration/screenedges_test.cpp
M  +10   -14   autotests/integration/window_selection_test.cpp
M  +4    -4    autotests/integration/x11_window_test.cpp
M  +5    -5    autotests/integration/xdgshellwindow_rules_test.cpp
M  +1    -1    autotests/integration/xdgshellwindow_test.cpp
M  +11   -11   src/backends/drm/drm_output.cpp
M  +2    -2    src/backends/drm/drm_output.h
M  +3    -2    src/backends/wayland/wayland_egl_backend.cpp
M  +1    -1    src/backends/wayland/wayland_output.cpp
M  +1    -1    src/backends/wayland/wayland_output.h
M  +3    -2    src/backends/wayland/wayland_qpainter_backend.cpp
M  +1    -1    src/backends/x11/standalone/x11_standalone_backend.cpp
M  +1    -1    src/backends/x11/standalone/x11_standalone_backend.h
M  +3    -3    src/backends/x11/standalone/x11_standalone_cursor.cpp
M  +2    -2    src/backends/x11/standalone/x11_standalone_windowselector.cpp
M  +3    -3    src/backends/x11/standalone/x11_standalone_windowselector.h
M  +2    -1    src/backends/x11/windowed/x11_windowed_egl_backend.cpp
M  +2    -2    src/backends/x11/windowed/x11_windowed_output.cpp
M  +2    -2    src/backends/x11/windowed/x11_windowed_output.h
M  +3    -1    src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp
M  +3    -3    src/composite.cpp
M  +2    -2    src/core/output.cpp
M  +2    -2    src/core/output.h
M  +4    -4    src/core/outputlayer.cpp
M  +6    -6    src/core/outputlayer.h
M  +31   -11   src/core/renderlayer.cpp
M  +10   -6    src/core/renderlayer.h
M  +9    -19   src/cursor.cpp
M  +11   -23   src/cursor.h
M  +3    -3    src/cursordelegate_opengl.cpp
M  +2    -2    src/cursordelegate_qpainter.cpp
M  +9    -9    src/cursorsource.cpp
M  +6    -6    src/cursorsource.h
M  +1    -1    src/decorations/decoratedclient.cpp
M  +2    -2    src/effects.cpp
M  +2    -2    src/effects.h
M  +4    -4    src/effects/colorpicker/colorpicker.cpp
M  +1    -1    src/effects/colorpicker/colorpicker.h
M  +1    -1    src/effects/magiclamp/magiclamp.cpp
M  +3    -3    src/effects/magnifier/magnifier.cpp
M  +2    -2    src/effects/magnifier/magnifier.h
M  +3    -3    src/effects/mouseclick/mouseclick.cpp
M  +1    -1    src/effects/mouseclick/mouseclick.h
M  +5    -5    src/effects/mousemark/mousemark.cpp
M  +4    -4    src/effects/mousemark/mousemark.h
M  +3    -3    src/effects/screenshot/screenshotdbusinterface1.cpp
M  +2    -2    src/effects/screenshot/screenshotdbusinterface2.cpp
M  +2    -2    src/effects/startupfeedback/startupfeedback.cpp
M  +1    -1    src/effects/startupfeedback/startupfeedback.h
M  +5    -5    src/effects/trackmouse/trackmouse.cpp
M  +1    -1    src/effects/trackmouse/trackmouse.h
M  +5    -5    src/effects/zoom/zoom.cpp
M  +1    -1    src/effects/zoom/zoom.h
M  +1    -1    src/libkwineffects/kwineffects.cpp
M  +5    -5    src/libkwineffects/kwineffects.h
M  +12   -3    src/libkwineffects/kwinglobals.h
M  +2    -2    src/main.cpp
M  +1    -1    src/main.h
M  +1    -1    src/main_x11.cpp
M  +1    -1    src/main_x11.h
M  +1    -1    src/plugins/qpa/platformcursor.cpp
M  +1    -1    src/plugins/screencast/screencastmanager.cpp
M  +7    -7    src/plugins/screencast/screencaststream.cpp
M  +4    -4    src/plugins/screencast/screencaststream.h
M  +4    -4    src/pointer_input.cpp
M  +15   -14   src/screenedge.cpp
M  +1    -1    src/screenedge.h
M  +1    -1    src/scripting/workspace_wrapper.cpp
M  +6    -6    src/wayland/pointer_interface.cpp
M  +1    -1    src/wayland/pointer_interface.h
M  +1    -1    src/window.cpp
M  +1    -1    src/window.h
M  +4    -5    src/workspace.cpp

https://invent.kde.org/plasma/kwin/commit/4cd25cf571d5a350b5e62e612a990bfdfa934bff
Comment 7 Vlad Zahorodnii 2023-02-21 13:29:10 UTC
*** Bug 465167 has been marked as a duplicate of this bug. ***