Bug 406800 - XWayland: bad cursor events after DisplayPort monitor hotplug
Summary: XWayland: bad cursor events after DisplayPort monitor hotplug
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.14.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-23 07:06 UTC by mappu04
Modified: 2024-02-15 22:02 UTC (History)
3 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 mappu04 2019-04-23 07:06:36 UTC
SUMMARY

After turning off and on a DisplayPort monitor, there's a region of my *other* monitor that warps the position of XWayland input events.

My setup
- Left monitor, 2560x1440 DVI (primary monitor)
- Right monitor, 1920x1200 DisplayPort


STEPS TO REPRODUCE

1. Use PC normally in Plasma Wayland session
2. Open an XWayland app (e.g. Chromium, or `QT_QPA_PLATFORM=xcb kate`) on left monitor, interact with it normally
3. Turn off right-monitor.
   - For DisplayPort this causes a hotplug event, all open windows move to the left monitor, kwin "compositor settings" window pops up
4. Turn on right-monitor.
   - Open windows move back


OBSERVED RESULT

Mouse input on all xwayland apps on left monitor is not properly recognized.
- Some input is recognized, but, with a bad relative offset. Or it's only recognized outside of a 1920x1200 region on the 2560x1440 display
- This includes click events being misdirected to wrong parts of the window, it affects dragging window, it affects mouse-hover on UI elements etc


EXPECTED RESULT

Expected to still be able to interact with XWayland apps normally


SOFTWARE/OS VERSIONS

Linux: Debian Buster amd64
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.54.0
Qt Version: 5.11.3
Xwayland 1.20.4
Radeon RX570 with AMDGPU / Mesa 18.3.4


ADDITIONAL INFORMATION

I originally raised this as an XWayland bug here https://gitlab.freedesktop.org/xorg/xserver/issues/680 

But the issue doesn't happen on GNOME Wayland, and nor on Weston (although that had a different problem).

So there is some aspect of this bug that is specific to Kwin_wayland.
Comment 1 Vlad Zahorodnii 2019-04-23 09:07:13 UTC
> it affects dragging window,
Hmm, this one is a bit interesting. Do you move windows by dragging titlebar?
Comment 2 mappu04 2019-04-27 21:26:15 UTC
(In reply to Vlad Zagorodniy from comment #1)
> > it affects dragging window,
> Hmm, this one is a bit interesting. Do you move windows by dragging titlebar?

The top-left 1920x1200 region of my 2560x1440 monitor is unusable. The mouse input seems to go through to the XWayland window, but to the wrong coordinate within the window. It has the correct y position but a wrong x position. The x position is fixed to x=1920-ish (screen coordinates).

Example: I put the Chromium window straddling the cut-off screen position. If i hover over a bookmark on the bookmarks bar, a different bookmark further-to-the-right is highlighted. On click, that other bookmark is loaded.

Chromium uses client-side window decorations and so moving is affected. When dragging from inside the window, the mouse "jumps" immediately to its "new effective" position.

If i enable system window decorations in Chromium, or if i run a different XWayland app (e.g. `QT_QPA_PLATFORM=xcb kate`), there's no problem moving the window by its border. I guess this happens all within Wayland, and, the problem is confined to XWayland.
Comment 3 Stijn Tintel 2020-01-07 10:29:44 UTC
This problem still exists with Plasma 5.17.4, Frameworks 5.64.0, Qt 5.13 and Wayland 1.17.0.
Comment 4 David Redondo 2022-01-19 15:30:52 UTC
This has been revamped in the meantime and we think this is fixed. Please reopen if it's still a problem