https://bugs.kde.org/show_bug.cgi?id=443357

            Bug ID: 443357
           Summary: Don't use atomic mode setting with virtual GPUs
                    (causes cursor offset)
           Product: kwin
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: platform-drm
          Assignee: kwin-bugs-n...@kde.org
          Reporter: ad...@happyassassin.net
  Target Milestone: ---

When running KDE on Wayland in a VM, the cursor location is slightly offset
from where it is drawn. Usually the 'real' location is slightly above and to
the left of the 'apparent' location. This is most obvious when drag-selecting
text in e.g. a text editor or console.

As explained in https://bugzilla.redhat.com/show_bug.cgi?id=2009304#c12 , this
is caused by using atomic mode setting: "The atomic API does not allow
specifying the cursor hotspot causing issues with virtual-machines which draw
the cursor them-selves. The solution is to not use the atomic API (at least for
the cursor) when running on say QXL graphics or a couple of other virtual
GPUs."

mutter has a denylist of virt-y GPUs to not use atomic mode setting on:

https://gitlab.gnome.org/GNOME/mutter/-/blob/af0460d0cedd5a66b2110ab2a99e67c647e7b6fb/src/backends/native/meta-kms-impl-device-atomic.c#L1149-1152

kwin should probably have the same. I think I found the place where atomic mode
setting is enabled -
https://github.com/KDE/kwin/blob/6a68caef7be72a3ae004c71bb844a0716966ca98/src/plugins/platforms/drm/drm_gpu.cpp#L90
and the function it calls - and it doesn't appear to have any such denylist.


STEPS TO REPRODUCE
1. Run KDE on Wayland in a virtual machine (e.g. a Fedora 34 KDE image in a
qemu VM using qxl or virtio graphics)
2. Run a text editor or console and get some text displayed
3. Position the cursor at the beginning of a line and try to select the text

OBSERVED RESULT
You will likely select from the line above, or not select at all as the cursor
is 'really' outside the window.

EXPECTED RESULT
Accurate selection due to cursor being where it appears to be.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Any KDE/Linux combination in a VM on Wayland.

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to