<table><tr><td style="">graesslin created this revision.<br />graesslin added reviewers: KWin, Plasma on Wayland, bshah.<br />Restricted Application added subscribers: kwin, plasma-devel.<br />Restricted Application added projects: Plasma on Wayland, KWin.</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D2531" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>For Xwayland windows we observed that passing pointer focus to another<br />
window does not trigger proper leave events on X. Which results in e.g.<br />
tooltip windows to show after the pointer moved to a completely<br />
different position on a completely different surface.</p>

<p>From an X perspective that's kind of correct: the pointer is still at<br />
the same position and the x11 api to query the cursor position is still<br />
on the last known position passed to Xwayland. Whether this problem can<br />
or should be fixed in Xwayland is not obvious.</p>

<p>To circumvent this problem KWin warps the xcb pointer to 0/0 whever an<br />
X window loses pointer focus. That way the X window gets a proper leave<br />
through the X protocol.</p>

<p>This created a problem though: when giving focus back to the X window it<br />
started to warp the pointer for maximized windows as KWin got pointer<br />
motion events through the X11 event filter for positions on the window<br />
decoration. These are passed into the screen edge filter which pushes<br />
the pointer back and warps our Wayland pointer. To solve this problem<br />
KWin no longer performs any actions for pointer motion in the X11 event<br />
filter if not on X11. The event filter needs to be reworked and most of<br />
it should be moved into the Platform API, if possible.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Reproduced situations where one could see that pointer updates<br />
don't trigger leave. E.g. going from a highlighted window to the decoration.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rKWIN KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>warp-x11-pointer-on-surface-leave</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D2531" rel="noreferrer">https://phabricator.kde.org/D2531</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>events.cpp<br />
pointer_input.cpp<br />
pointer_input.h</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>graesslin, KWin, Plasma on Wayland, bshah<br /><strong>Cc: </strong>plasma-devel, kwin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas<br /></div>