[Differential] [Request, 675 lines] D3506: Implement support for pointer constraints
graesslin (Martin Gräßlin)
noreply at phabricator.kde.org
Fri Nov 25 12:58:11 UTC 2016
graesslin created this revision.
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added subscribers: kwin, plasma-devel.
Restricted Application added projects: Plasma on Wayland, KWin.
REVISION SUMMARY
There are two types of constraints supported:
1. Pointer confinement
2. Pointer locking
In the case of confinement the pointer is confined to a given region of
the surface. This is comparable to general operation where the pointer
is confined to the screen region.
In the second case the pointer gets locked. That means it cannot move at
all. No further position updates are provided, only relative motion
events can go to the application. There is a hint about cursor position
update on unlock which is not yet implemented in KWayland::Server, thus
also not in this change.
The implementation in KWin grants the requests for pointer constraints
when the pointer enters the constrained region, either by pointer
movement or by e.g. stacking order changes. There is no confirmation
from user required to enter that mode. But we want to show an OSD when
the pointer gets constrained, this is not yet implemented, though.
Breaking an active constraint is relatively easy. E.g. changing the
stacking order will break the constraint if another surface is under the
cursor. Also (in case of confinement) moving the pointer to an
overlapping window breaks the confinement. But as soon as one moves the
pointer back to the window a constraint might get honoured again.
To properly break there is a dedicated event filter. It listens for a
long press of the Escape key. If hold for 3sec the pointer constraint is
broken and not activated again till the pointer got moved out of the
window. Afterward when moving in the pointer might activate again.
The escape filter ensures that the key press is forwarded to the
application if it's a short press or if another key gets pressed during
the three seconds. If the three seconds way fires, the later escape
release is not sent to the application.
This basic interaction is also ensured through an added auto test.
This change implements https://phabricator.kde.org/T4605.
TEST PLAN
Added auto test and nested KWin Wayland with https://phabricator.kde.org/D3488
REPOSITORY
rKWIN KWin
BRANCH
pointer-constraints
REVISION DETAIL
https://phabricator.kde.org/D3506
AFFECTED FILES
autotests/integration/CMakeLists.txt
autotests/integration/kwin_wayland_test.h
autotests/integration/pointer_constraints_test.cpp
autotests/integration/test_helpers.cpp
input.cpp
input.h
keyboard_input.cpp
pointer_input.cpp
pointer_input.h
wayland_server.cpp
EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/
To: graesslin, #kwin, #plasma_on_wayland
Cc: plasma-devel, kwin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, eliasp, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161125/c9c95391/attachment.html>
More information about the Plasma-devel
mailing list