Bug 2011066 - Real cursor position is slightly offset from displayed position on Wayland in virtual machine (KDE case)
Summary: Real cursor position is slightly offset from displayed position on Wayland in...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kwin
Version: 35
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Daniel Vrátil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedBlocker
Depends On:
Blocks: F35FinalBlocker
TreeView+ depends on / blocked
 
Reported: 2021-10-05 21:23 UTC by Adam Williamson
Modified: 2022-03-15 14:40 UTC (History)
11 users (show)

Fixed In Version: kwin-5.22.5-2.fc35
Clone Of:
Environment:
Last Closed: 2021-10-07 23:31:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
video of a plasma-wayland session bug fixed (1.26 MB, video/mp4)
2021-10-07 12:28 UTC, Geraldo Simião
no flags Details
video of same bug at F36 KDE beta (1.32 MB, video/webm)
2022-03-14 18:00 UTC, Geraldo Simião
no flags Details


Links
System ID Private Priority Status Summary Last Updated
KDE Software Compilation 443357 0 NOR UNCONFIRMED Real cursor position is slightly offset from displayed position on Wayland in virtual machine 2021-10-05 21:24:04 UTC
Red Hat Bugzilla 2009304 1 unspecified CLOSED Mouse cursor offset in GNOME VMs with Wayland (but not X11), due to use of Atomic API 2021-10-07 23:31:54 UTC

Internal Links: 2009304

Description Adam Williamson 2021-10-05 21:23:42 UTC
This is similar to https://bugzilla.redhat.com/show_bug.cgi?id=2009304 , but for KDE/Plasma.

If you boot a KDE live image in a windowed qemu VM using qxl or virtio graphics (which are the two most recent default settings in qemu) and log into Plasma on Wayland (the bug does not affect Plasma on X11), the real cursor position will be slightly offset from where it's drawn. For me the real position is always slightly above and to the left of the 'apparent' position. This is particularly noticeable when drag-selecting text.

There is/was a similar issue on GNOME, which is fixed *on GNOME* by disabling atomic mode setting for virtual GPUs. See https://bugzilla.redhat.com/show_bug.cgi?id=2009304#c12 . I assumed that disabling atomic mode setting on Plasma would similarly solve the problem there, but oddly, it does not seem to. I booted an installed system with KWIN_DRM_NO_AMS=1 in /etc/environment , and confirmed with `qdbus org.kde.KWin / KWin supportInformation` that it was really disabled, but the cursor offset problem was still there. So now I'm not sure how we could go about fixing this.

I've filed this upstream as https://bugs.kde.org/show_bug.cgi?id=443357 .

Since 2009304 was accepted as a blocker when we assumed the bug affecting Workstation and KDE was one bug, I'm proposing this as a blocker too.

Comment 1 Raphael Groner 2021-10-06 04:18:05 UTC
Well, I see high offsets with third screen connected as well but without virtualisation and in wayland session. Not sure if that's the same bug. Reproducible also with Fedora 34 though.

Comment 2 Raphael Groner 2021-10-06 04:23:34 UTC
Did anyone try the other workaround given in bug #2006746 to remove spice-vdagent from inside VM?

Comment 3 Adam Williamson 2021-10-06 06:17:06 UTC
well, 2006746 doesn't really appear to be the same bug as the 'small, permanent offset' case. I can test it tomorrow, though.

Comment 4 Adam Williamson 2021-10-06 15:52:55 UTC
jadahl - who dealt with the similar problems on the mutter (GNOME) side - passes this along:

"one possibility is that kde changed to do what mutter did for a while, which is to emulate atomic mode setting with legacy mode setting. what mutter did was to offset things manually, always setting a 0,0 hotspot. when the virtual machine viewer bugs showed up, I had to re-introduce the hotspot to the atomic mode setting layer even if it couldn't be used"

Comment 5 Adam Williamson 2021-10-06 16:10:00 UTC
Aha. Looks like this was fixed on the development branch:

https://github.com/KDE/kwin/commit/998bbf4eba724a9b94a5bae62182456b85b11383#diff-034885748897f413c645e3efd125d7c0db9a8454d580f6093e40c885d974c818

unfortunately, that was after a big change that moved a ton of code around:

https://github.com/KDE/kwin/commit/586efe94d4f3b2c9759a26f27661edcaa54dce0b#diff-034885748897f413c645e3efd125d7c0db9a8454d580f6093e40c885d974c818

so I'm going to have to put on my poking hat to figure out how to backport it.

Comment 6 Adam Williamson 2021-10-06 17:51:55 UTC
+4 in https://pagure.io/fedora-qa/blocker-review/issue/505 , accepting as a final blocker. Though it's possible we might need to waive this if nobody can figure out how to fix it on 5.22 branch. I'm trying my best.

Comment 7 Fedora Update System 2021-10-06 20:11:29 UTC
FEDORA-2021-7fa4541d4f has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-7fa4541d4f

Comment 8 Adam Williamson 2021-10-06 20:12:40 UTC
OK, so somewhat to my surprise my speculative attempt to backport the fix seemed to actually a) compile, b) not blow anything up and, most astonishingly, c) work. Please try it out and see how it goes...

Comment 9 Geraldo Simião 2021-10-07 12:28:14 UTC
Created attachment 1830363 [details]
video of a plasma-wayland session bug fixed

Adam, I tested right now, i think you fixed it yes congratulations!!!
kwin-5.22.5-2 Wayland session on F35 VM UEFI virtio dideo

Comment 10 Kamil Páral 2021-10-07 13:00:48 UTC
(In reply to Fedora Update System from comment #7)
> FEDORA-2021-7fa4541d4f has been submitted as an update to Fedora 35.
> https://bodhi.fedoraproject.org/updates/FEDORA-2021-7fa4541d4f

Works, thanks.

Comment 11 Fedora Update System 2021-10-07 23:31:59 UTC
FEDORA-2021-7fa4541d4f has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 postix 2021-12-02 14:29:51 UTC
Is this an issue of the host or the guest system?

I have installed an up-to-date "Fedora 35" guest system on "openSUSE TW" (KDE) via QEMU and can reproduce this issue using 
```
    <video>
      <model type="virtio" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0"/>
    </video>
```
under KDE Plasma Wayland 5.23.3, Qt 5.15.2, Kernel 5.15.5, if I change the resolution to something else than the native display resolution and 100% scaling, e.g. 200% scaling.

Comment 13 Geraldo Simião 2022-03-14 17:58:42 UTC
It seems that problem get back at F36 KDE spin. Should I open another ticket or do we continue with this one?

Comment 14 Geraldo Simião 2022-03-14 18:00:11 UTC
Created attachment 1865892 [details]
video of same bug at F36 KDE beta

It seems we get a regression on F36 now.

Comment 15 Kamil Páral 2022-03-15 14:40:59 UTC
The F36 regression was reported as bug 2063969. Let's continue the discussion there.


Note You need to log in before you can comment on or make changes to this bug.