Bug 446073 - wrong mouse position when scaled inside SPICE virtual machine
Summary: wrong mouse position when scaled inside SPICE virtual machine
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.23.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-25 11:56 UTC by lilydjwg
Modified: 2024-04-28 10:28 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lilydjwg 2021-11-25 11:56:04 UTC
SUMMARY

When I'm running the Plasma Wayland session in a QEMU / KVM virtual machine via the SPICE protocol and the display is scaled, the mouse position is wrong.

STEPS TO REPRODUCE
1. Run the virtual machine and log in Plasma Wayland session
2. Set the scale factor to 200% in settings and apply
3. Move around and click

OBSERVED RESULT
When the mouse cursor is shown at coordinate (x, y), the input event is actually happening at (2x, 2y), i.e. goes too far to the right and bottom.

EXPECTED RESULT
The input event should happen where the cursor is shown.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
It is fine with Plasma X11. It has a totally different issue with wlroots compositors (cursor upside down instead of scaled away).
Comment 1 Yu-Hsuan Lai 2021-11-30 21:55:29 UTC
Similar problem with me. Not in virtual machine, but on a normal destkop environment with Global Scale set to 200%. The cursor position is wrong for all Qt apps, making them unusable.
Comment 2 lilydjwg 2022-07-20 05:09:26 UTC
This issue is gone, but the mouse cursor is flipped vertically along the bottom edge, making it hard to position (wlroots has this problem too).
Comment 3 Damian Kaczmarek 2022-10-01 04:02:00 UTC
I have this problem too but weirdly enough the problem does not happen immediately after connecting the extra monitor, it appears to happen after I start using some apps. Not sure what exactly the trigger. kwin 5.25.5
Comment 4 Damian Kaczmarek 2022-10-01 04:02:51 UTC
Oh sorry I misread the title of the bug. The bug for me happens with my laptop having a 4k screen and me connecting a FullHD screen.
Comment 5 lilydjwg 2022-10-01 04:58:44 UTC
The inverted mouse cursor is gone and this issue is back.

> The bug for me happens with my laptop having a 4k screen and me connecting a FullHD screen.

I have the opposite. My laptop is 1920x1080 and my external monitor is 3840x2160. (But does it really matter? It's in a virtual machine anyway.)
Comment 6 lilydjwg 2024-04-28 10:28:09 UTC
It no longer happens.