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

--- Comment #7 from Martin Gräßlin <mgraess...@kde.org> ---
Git commit 0bb587dcb9de0a3bc688019fd66b224e713b3501 by Martin Gräßlin.
Committed on 27/03/2017 at 05:08.
Pushed by graesslin into branch 'master'.

Ensure PointerInputRedirection::processMotion finishes prior to warping

Summary:
Consider the following situation: we have three InputEventFilter linked
in the sequence A - B - C.

The input filters are processing pointer motion events. The expected
behavior is that the new motion is processed in the sequence
   A -> B -> C

So far this did not work correctly if the pointer gets warped during the
processing. If e.g. filter B warps the pointer we get a motion sequence:
   A (1) -> B (1) -> A (2) -> B (2) -> C (2) -> C (1)

The filters following the one warping the pointer get first the newer
than the older position. This is obviously wrong. Unfortunately it is not
just a theoretical condition, but a condition happening when interacting
with the screenedges, which warp the pointer.

This change introduces a PositionUpdateBlocker in
PointerInputRedirection::processMotion to ensure that a processMotion
call finishes prior to the next update. If the PositionUpdateBlocker is
blocked the new position gets scheduled and processed once the
PositionUpdateBlocker gets destroyed.

With this we get the expected sequence for B warping pointer:
   A (1) -> B (1) -> C (1) -> A (2) -> B (2) -> C (2)

This should hopefully improve the interaction with screen edges on
Wayland.

Test Plan:
Added an auto test demonstrating the issue of incorrect
ordering caused by screenedges. Prior to the change the test is failing.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

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

M  +46   -0    autotests/integration/pointer_input.cpp
M  +49   -0    pointer_input.cpp

https://commits.kde.org/kwin/0bb587dcb9de0a3bc688019fd66b224e713b3501

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

Reply via email to