Bug 424589 - Dragging things shows clipped thumbnails
Summary: Dragging things shows clipped thumbnails
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-23 21:48 UTC by Nate Graham
Modified: 2020-10-29 08:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screen recording (2.90 MB, video/mp4)
2020-07-23 21:48 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2020-07-23 21:48:07 UTC
All KDE software built from git master as of this afternoon.

Wayland, 4k screen, 200% or 250% scaling.

When I drag anything that results in a thumbnail appearing by the cursor, the thumbnail is clipped and pixelated instead of displayed correctly. See the attached screen recording
Comment 1 Nate Graham 2020-07-23 21:48:34 UTC
Created attachment 130352 [details]
screen recording
Comment 2 Vlad Zahorodnii 2020-10-23 08:02:16 UTC
The problem is that sometimes the size of the dnd cursor surface may exceed the capabilities of the cursor plane. In which case, kwin should fallback to software cursor rendering.
Comment 3 Vlad Zahorodnii 2020-10-25 08:57:29 UTC
Git commit 64b7cc3cf36297915d2385f107cff6ba240b296a by Vlad Zahorodnii.
Committed on 25/10/2020 at 08:57.
Pushed by vladz into branch 'master'.

wayland: Fix drag-and-drop cursors with hidpi

QImage::rect() returns a rect in the native pixels, however we need a
rect that is in the device independent pixels.

M  +22   -14   pointer_input.cpp

https://invent.kde.org/plasma/kwin/commit/64b7cc3cf36297915d2385f107cff6ba240b296a
Comment 4 Vlad Zahorodnii 2020-10-25 08:57:37 UTC
Git commit 6b940c128019823034d872cc7ae717330d92d43f by Vlad Zahorodnii.
Committed on 25/10/2020 at 08:57.
Pushed by vladz into branch 'master'.

scenes/opengl: Properly render cursors with hidpi

GLTexture::width() and GLTexture::height() return the size of the cursor
texture in native pixels, but we need a size in device independent pixels.

M  +2    -1    plugins/scenes/opengl/scene_opengl.cpp

https://invent.kde.org/plasma/kwin/commit/6b940c128019823034d872cc7ae717330d92d43f
Comment 5 Vlad Zahorodnii 2020-10-25 08:58:03 UTC
Git commit f123990930bf43f2e31d44d5c318f933ee20591c by Vlad Zahorodnii.
Committed on 25/10/2020 at 08:58.
Pushed by vladz into branch 'Plasma/5.20'.

wayland: Fix drag-and-drop cursors with hidpi

QImage::rect() returns a rect in the native pixels, however we need a
rect that is in the device independent pixels.


(cherry picked from commit 64b7cc3cf36297915d2385f107cff6ba240b296a)

M  +22   -14   pointer_input.cpp

https://invent.kde.org/plasma/kwin/commit/f123990930bf43f2e31d44d5c318f933ee20591c
Comment 6 Vlad Zahorodnii 2020-10-25 08:58:37 UTC
Git commit 9d2b27aebb862ed6ad3fa88760efd49369a4e4ae by Vlad Zahorodnii.
Committed on 25/10/2020 at 08:58.
Pushed by vladz into branch 'Plasma/5.20'.

scenes/opengl: Properly render cursors with hidpi

GLTexture::width() and GLTexture::height() return the size of the cursor
texture in native pixels, but we need a size in device independent pixels.


(cherry picked from commit 6b940c128019823034d872cc7ae717330d92d43f)

M  +2    -1    plugins/scenes/opengl/scene_opengl.cpp

https://invent.kde.org/plasma/kwin/commit/9d2b27aebb862ed6ad3fa88760efd49369a4e4ae
Comment 7 Vlad Zahorodnii 2020-10-27 06:04:33 UTC
Git commit c8eeefbd7ddb6724c7b2ea8ec282046edd8e74c7 by Vlad Zahorodnii.
Committed on 27/10/2020 at 06:04.
Pushed by vladz into branch 'master'.

platform/drm: Fix clipped HiDPI hardware cursors

If an output is rotated, we will compute a transform matrix for the
cursor plane to rotate its contents.

In order to compute that matrix we need the rect of the cursor in the
device-independent pixels, the scale factor and the output transform.

The problem is that we provide a rect of the cursor in the native
pixels. This may result in the cursor being partially or fully clipped.

M  +5    -0    cursor.cpp
M  +1    -0    cursor.h
M  +4    -3    plugins/platforms/drm/drm_output.cpp
M  +1    -2    plugins/scenes/opengl/scene_opengl.cpp

https://invent.kde.org/plasma/kwin/commit/c8eeefbd7ddb6724c7b2ea8ec282046edd8e74c7
Comment 8 Vlad Zahorodnii 2020-10-27 06:42:23 UTC
Git commit 44dcb6d0a586cb9c5e3ba4d030a7b06bf00ca4f4 by Vlad Zahorodnii.
Committed on 27/10/2020 at 06:29.
Pushed by vladz into branch 'Plasma/5.20'.

platform/drm: Fix clipped HiDPI hardware cursors

If an output is rotated, we will compute a transform matrix for the
cursor plane to rotate its contents.

In order to compute that matrix we need the rect of the cursor in the
device-independent pixels, the scale factor and the output transform.

The problem is that we provide a rect of the cursor in the native
pixels. This may result in the cursor being partially or fully clipped.
(cherry picked from commit c8eeefbd7ddb6724c7b2ea8ec282046edd8e74c7)

M  +5    -0    cursor.cpp
M  +1    -0    cursor.h
M  +4    -3    plugins/platforms/drm/drm_output.cpp
M  +1    -2    plugins/scenes/opengl/scene_opengl.cpp

https://invent.kde.org/plasma/kwin/commit/44dcb6d0a586cb9c5e3ba4d030a7b06bf00ca4f4
Comment 9 Bug Janitor Service 2020-10-27 13:00:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/392
Comment 10 Vlad Zahorodnii 2020-10-29 08:53:19 UTC
Git commit 54427623716a42ade3c8c33eb8a6b1e132e2bdb4 by Vlad Zahorodnii.
Committed on 29/10/2020 at 08:53.
Pushed by vladz into branch 'master'.

platforms/drm: Use a software cursor if the cursor image is too big

When dragging files on the desktop, the cursor image might be just too
big for the cursor plane, in which case we need to abandon hardware
cursors for a brief moment and use a software cursor. Once the files
have been dropped and the cursor image is small enough, we can go back
to using hw cursors.

M  +29   -4    platform.cpp
M  +18   -0    platform.h
M  +32   -21   plugins/platforms/drm/drm_backend.cpp
M  +2    -1    plugins/platforms/drm/drm_backend.h
M  +1    -1    plugins/platforms/drm/drm_gpu.cpp
M  +25   -10   plugins/platforms/drm/drm_output.cpp
M  +1    -1    plugins/platforms/drm/drm_output.h
M  +1    -1    plugins/platforms/fbdev/fb_backend.cpp
M  +1    -1    plugins/platforms/virtual/virtual_backend.cpp

https://invent.kde.org/plasma/kwin/commit/54427623716a42ade3c8c33eb8a6b1e132e2bdb4