Bug 478614 - Cursor "hit box" is offset under Wayland on QEMU VMs
Summary: Cursor "hit box" is offset under Wayland on QEMU VMs
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.90.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-16 19:31 UTC by kritomas
Modified: 2024-04-08 20:22 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The bug in action. Notice, how the cursor is almost correctly placed at the Show intro page button, but drastically misplaced at the X. (3.48 MB, video/webm)
2023-12-16 19:31 UTC, kritomas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kritomas 2023-12-16 19:31:45 UTC
Created attachment 164228 [details]
The bug in action. Notice, how the cursor is almost correctly placed at the Show intro page button, but drastically misplaced at the X.

SUMMARY
The cursor is rendered at the wrong position on wayland.


STEPS TO REPRODUCE
1. Start KDE Neon Unstable (at this moment running KDE Plasma 6 Beta 1), wayland session.
2. Open any window.
3. Try to click the X.

OBSERVED RESULT
The cursor clicks at a different position than it actually is.

EXPECTED RESULT
The cursor should click where it's rendered

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: KDE Neon Unstable Edition
(available in About System)
KDE Plasma Version: 5.90.90
KDE Frameworks Version: 5.247.0
Qt Version: 6.6.1

ADDITIONAL INFORMATION
Tested on QEMU, not a physical machine.
Comment 1 guimarcalsilva 2023-12-17 03:57:12 UTC

*** This bug has been marked as a duplicate of bug 427060 ***
Comment 2 Nate Graham 2023-12-20 19:39:55 UTC
See also Bug 478614, which was the same issue byt for VMWare and VIrtualBox VMs, and that one looks to have been fixed already.
Comment 3 tagwerk19 2023-12-23 14:01:29 UTC
Also encountered this...

Seems OK just after an install as KVM guest (neon-unstable-20231220-0758.iso).

It is wrong after I changed the Display/Monitor size (QXL graphics). I changed to 1440x900, although I had to log in with X to change it and then log back in with Wayland to check. 

There's a comment
    https://bugs.kde.org/show_bug.cgi?id=427060#c44
about the offset depending on where you are on the screen. Seems also to be the case here.

It is better behaved with Virtio graphics.
Comment 4 Zamundaaa 2024-02-19 16:04:34 UTC
If it depends on the mode, then I'm quite sure it's a bug in the VM driver. KWin just sets a cursor image with a hotspot (which is independent of the cursor position), and it's up to the VM driver and the VM to translate that to a proper cursor position on the host.
Comment 5 tagwerk19 2024-02-21 08:02:45 UTC
(In reply to Zamundaaa from comment #4)
> If it depends on the mode, then I'm quite sure it's a bug in the VM driver.
> KWin just sets a cursor image with a hotspot (which is independent of the
> cursor position), and it's up to the VM driver and the VM to translate that
> to a proper cursor position on the host.
It does seem to be fragile...

I know Neon Testing is in flux at the moment but
    Wayland with Video QXL gets the "offset"
    Wayland with Video Virtio is fine
    X11 with Video QXL is fine
    X11 with Video Virtio is fine

I'm pretty sure it worked for a while and has slipped again.



On Neon testing
Comment 6 Adam Williamson 2024-04-08 20:22:00 UTC
I'm seeing offset today in Fedora 40 on Wayland with a libvirt VM with virtio graphics :( The usual "real position is slightly lower and to the right of the apparent position" case.