Bug 427605

Summary: Cropped pointer cursors
Product: [Plasma] kwin Reporter: Vlad Zahorodnii <vlad.zahorodnii>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: claudius.ellsel, nate
Priority: NOR Flags: vlad.zahorodnii: Wayland+
vlad.zahorodnii: X11-
Version: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.20.1
Attachments: The pointer cursor is cropped in half
Cursor over a Firefox Picture-in-Picture window

Description Vlad Zahorodnii 2020-10-12 18:41:40 UTC
Created attachment 132305 [details]
The pointer cursor is cropped in half

SUMMARY
Sometimes the pointer cursor is cropped. This bug can be reproduced with both Qt and GTK clients. Not sure how to reliably reproduce it.
Comment 1 Vlad Zahorodnii 2020-10-12 18:42:53 UTC
The screenshot effect returns screenshots with a properly rendered cursor.
Comment 2 Vlad Zahorodnii 2020-10-12 18:54:14 UTC
Created attachment 132306 [details]
Cursor over a Firefox Picture-in-Picture window

It seems like I can reliably reproduce this bug by hovering any edge of a Firefox Picture-in-Picture window.
Comment 3 Vlad Zahorodnii 2020-10-12 18:57:28 UTC
Cursors are not cropped when kwin runs with KWIN_FORCE_SW_CURSOR=1.
Comment 4 Bug Janitor Service 2020-10-12 21:09:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/336
Comment 5 Vlad Zahorodnii 2020-10-16 17:04:12 UTC
Git commit 3b8e489b6f384239cbe30a2dccc064a4ecc2c9bd by Vlad Zahorodnii.
Committed on 16/10/2020 at 17:03.
Pushed by vladz into branch 'master'.

platforms/drm: Compute correct cursor transform matrix

Currently, when the DRM platform uses cursor planes, the cursor on
a rotated output may be cropped because the math behind the current
cursor transform matrix is off.

In order to fix the cropping issue, this change replaces the current
cursor transform matrix with the core part of the surface-to-buffer
matrix, which was written against the wl_output spec.
Related: bug 427060

M  +39   -11   plugins/platforms/drm/drm_output.cpp
M  +0    -1    plugins/platforms/drm/drm_output.h

https://invent.kde.org/plasma/kwin/commit/3b8e489b6f384239cbe30a2dccc064a4ecc2c9bd
Comment 6 Vlad Zahorodnii 2020-10-16 17:14:07 UTC
Git commit 1fd9ae618aaf8b9fcd5b644fa3039ec782d6355f by Vlad Zahorodnii.
Committed on 16/10/2020 at 17:06.
Pushed by vladz into branch 'Plasma/5.20'.

platforms/drm: Compute correct cursor transform matrix

Currently, when the DRM platform uses cursor planes, the cursor on
a rotated output may be cropped because the math behind the current
cursor transform matrix is off.

In order to fix the cropping issue, this change replaces the current
cursor transform matrix with the core part of the surface-to-buffer
matrix, which was written against the wl_output spec.
Related: bug 427060

M  +39   -11   plugins/platforms/drm/drm_output.cpp
M  +0    -1    plugins/platforms/drm/drm_output.h

https://invent.kde.org/plasma/kwin/commit/1fd9ae618aaf8b9fcd5b644fa3039ec782d6355f
Comment 7 Claudius Ellsel 2020-10-18 15:39:46 UTC
Is this (https://bugs.kde.org/show_bug.cgi?id=427872) related?
Comment 8 Vlad Zahorodnii 2020-10-18 16:05:24 UTC
(In reply to Claudius Ellsel from comment #7)
> Is this (https://bugs.kde.org/show_bug.cgi?id=427872) related?

If the left monitor is rotated, then yes, it is.
Comment 9 Claudius Ellsel 2020-10-18 16:34:15 UTC
Yes, the left monitor is rotated for me. Marking as duplicate, then? Change back if it is not.
Comment 10 Claudius Ellsel 2020-10-18 16:34:52 UTC
*** Bug 427872 has been marked as a duplicate of this bug. ***