Bug 449331 - Cursor has offset when running inside VM
Summary: Cursor has offset when running inside VM
Status: RESOLVED DUPLICATE of bug 427060
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: 5.23.90
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2022-01-29 16:24 UTC by postix
Modified: 2022-03-12 11:13 UTC (History)
3 users (show)

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


Attachments
Screenshot (1.27 MB, image/png)
2022-01-29 16:24 UTC, postix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2022-01-29 16:24:00 UTC
Created attachment 146048 [details]
Screenshot

SUMMARY


STEPS TO REPRODUCE
1.  200% scaling, VirtualBox VM, FullScreen or Window mode
2.  Place the mouse cursor on the right edge of a window to resize it

OBSERVED RESULT
The only region to resize is between the red lines shown in the screenshot.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon Testing
KDE Plasma Version: 5.23.90
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Comment 1 postix 2022-01-29 17:26:13 UTC
When looking closer, I have noticed that the drag area on the left is actually inside of the window w/ the same gap as on the right side.
Same goes for the top edge and the bottom edge: So the edges of the rectangular  drag area is shifted by a few pixels to the bottom-right compared to the drawn window.
Comment 2 Vlad Zahorodnii 2022-02-04 11:20:05 UTC
Not sure, but it seems like a cursor issue. Can you try running plasma with the KWIN_DRM_NO_AMS=1 environment variable? Note that you may need the latest kwin as there's a known crash in beta.
Comment 3 postix 2022-02-13 14:22:27 UTC
(In reply to Vlad Zahorodnii from comment #2)
> Not sure, but it seems like a cursor issue. 
> Can you try running plasma with the KWIN_DRM_NO_AMS=1 environment variable?

On KDE Neon Testing, I have switched to another tty, ran `export KWIN_DRM_NO_AMS=1 && dbus-run-session startplasma-wayland` and can confirm, that setting this environment variable fixes the issue.
Comment 4 Vlad Zahorodnii 2022-02-14 09:43:54 UTC
Okay this sounds like a cursor hotspot issue when running in a VM.
Comment 5 postix 2022-02-14 10:08:05 UTC
(In reply to Vlad Zahorodnii from comment #4)
> Okay this sounds like a cursor hotspot issue when running in a VM.

But just to make it explicit: There's only an offset related to the changing of the size of a window. All other areas of interaction do not show this offset.
Comment 6 Zamundaaa 2022-02-15 19:44:06 UTC
With legacy functions the hotspot only works because we pass it into drmModeSetCursor2 (which is a workaround for limitations in v1 of drmModeSetCursor) - with AMS the VM has absolutely no information about what we use the cursor plane for, or what the hotspot is. It assuming that we display the cursor in the cursor plane is also a hack and could cause more breakage soon.

To solve this problem either VMs need to stop making such assumptions and/or some new drm properties would need to be introduced that signal whether or not a plane is used at all for the cursor and if so, what the cursor hotspot is supposed to be.
Comment 7 postix 2022-03-12 11:13:54 UTC

*** This bug has been marked as a duplicate of bug 427060 ***