Bug 417444

Summary: Mouse input to GTK apps on XWayland is missplaced
Product: [Plasma] kwin Reporter: Matej Mrenica <matejm98mthw>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Severity: normal CC: bugseforuns, magiblot, matejm98mthw, nate, tom
Priority: NOR Flags: vlad.zahorodnii: ReviewRequest+
Version: 5.18.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: https://phabricator.kde.org/D27375
Latest Commit: Version Fixed In: 5.18.1

Description Matej Mrenica 2020-02-11 18:54:36 UTC
To interact with something you have to move your mouse a little down and to the right.
Three examples:

(1)Open https://sketch.io/sketchpad/ in Firefox and try to draw something. You can clearly see the line is not created under the cursor, but about 20px (may vary) up and to the left.

(2)OR try clicking on anything. Clicking on the window buttons (close, minimize,maximize) doesn't work because the clicks land somewhere else.

(3)OR try to resize a window. It's impossible to resize a window on the right side and at the bottom. The "edge" of the window on top and on the left side is moved a little inside the window. 

KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 1 Matej Mrenica 2020-02-13 20:10:02 UTC
The proposed patch fixes this.
Comment 2 Vlad Zahorodnii 2020-02-13 23:52:21 UTC
Git commit 1181af2cd16569fb93680de352a4c050533bffff by Vlad Zahorodnii.
Committed on 13/02/2020 at 23:49.
Pushed by vladz into branch 'Plasma/5.18'.

Provide input geometry and input transformation matrix for Xwayland clients

We need to provide the input geometry and the input transformation
matrix for Xwayland clients in order to make sure that input events
are correctly mapped from the global screen coordinates to the
screen-local coordinates.
FIXED-IN: 5.18.1

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27375

M  +115  -12   autotests/integration/xwayland_input_test.cpp
M  +16   -0    x11client.cpp
M  +3    -0    x11client.h

Comment 3 Vlad Zahorodnii 2020-02-14 00:04:37 UTC
(In reply to mthw0 from comment #1)
> The proposed patch fixes this.

Thank you for testing it.
Comment 4 Nate Graham 2020-02-15 23:53:55 UTC
*** Bug 417669 has been marked as a duplicate of this bug. ***
Comment 5 Patrick Silva 2020-02-18 22:39:55 UTC
*** Bug 416546 has been marked as a duplicate of this bug. ***
Comment 6 magiblot 2020-06-09 15:30:58 UTC
There are still misplacing issues. For instance:

1. Have an unmaximized Firefox window -> OK
2. Maximize Firefox -> KO
3. Click on another window and then click back on maximized Firefox -> OK