Bug 479154 - Cursor does not scale with output scale (Wayland, Plasma 6)
Summary: Cursor does not scale with output scale (Wayland, Plasma 6)
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-29 12:16 UTC by Stefan Hoffmeister
Modified: 2024-01-09 08:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot shows correct rendering, but that's not what is shown (23.38 KB, image/png)
2023-12-30 20:54 UTC, Stefan Hoffmeister
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Hoffmeister 2023-12-29 12:16:59 UTC
SUMMARY

When changing the scale of an output, all aspect of the cursor should scale as well, together with the change.

Right now, no scaling appears to take place in a pure Wayland, Plasma 6 beta2+, KDE stack (i.e. this defect here is not about Xwayland)


STEPS TO REPRODUCE
1. log in
2. "Display Properties" -> set scale to 3 == 300%
3. Apply

OBSERVED RESULT

* Output itself is now scaled, but cursor remains at the previous scale - typically too small. 
* Cursor hotspot / hitbox is difficult to spot, it does not match where one expects it to be

EXPECTED RESULT

* cursor is scaled according to output scale
* cursor hotspot / hitbox matches with what is on screen


A good way to see all this is to run on a high-resolution screen with a very _integral_ scale factor (i.e. 3). This is also not about fractional scaling.
Comment 1 Zamundaaa 2023-12-29 23:55:55 UTC
Can't reproduce. Is this in a VM or on bare metal?
Comment 2 Stefan Hoffmeister 2023-12-30 19:54:17 UTC
Indeed, a virtual machine, vmwgfx of VMware, with
```
# Force atomic mode-setting
export KWIN_DRM_NO_AMS=0

# Force software cursors
export KWIN_FORCE_SW_CURSOR=1
```

So, I suspect, the software cursor path might be it? I will get to the vmwgfx GEM / GBM part next week++, but for quite some more time I expect to have to run with software cursors forced on.

Sorry that I keep forgetting to provide the environment details!
Comment 3 Stefan Hoffmeister 2023-12-30 20:54:22 UTC
Created attachment 164561 [details]
Screenshot shows correct rendering, but that's not what is shown

Funny enough, taking a screenshot (with Spectacle) shows _correct_ rendering - but that screenshot does not reflect what I see on screen.

On screen I do not see the large cursor, but the small (unscaled?) cursor.
Comment 4 Vlad Zahorodnii 2024-01-09 08:46:31 UTC
Git commit 429b421dd40cf12a515134524c70cb4eb3d06fe4 by Vlad Zahorodnii, on behalf of Stefan Hoffmeister.
Committed on 09/01/2024 at 09:46.
Pushed by vladz into branch 'master'.

scene: Fix scaled rendering of software cursors

M  +5    -5    src/scene/cursordelegate_opengl.cpp

https://invent.kde.org/plasma/kwin/-/commit/429b421dd40cf12a515134524c70cb4eb3d06fe4