summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-02-25 16:25:08 -0500
committerKristian Høgsberg <krh@bitplanet.net>2013-11-30 22:55:56 -0800
commit8a7b60b4be9e66f61fcef725f42b605e920a7e79 (patch)
treed637e7395ca09e1109f657a8ccb249d79de024ef
parent5a019e38a1316a31072a9cb6de8da4377f3cfad5 (diff)
protocol: Introduce pointer_lock interfacepointer-lock-2
The pointer_lock interface is modelled after the HTML5 pointer lock extension: https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html The extension allows a wayland client to lock the pointer while a surface is active. While the pointer is locked, the client receives relative motion events and the pointer position isn't updated.
-rw-r--r--protocol/wayland.xml37
1 files changed, 36 insertions, 1 deletions
diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 61fde84..a5e4666 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -1236,7 +1236,7 @@
</request>
</interface>
- <interface name="wl_seat" version="3">
+ <interface name="wl_seat" version="4">
<description summary="group of input devices">
A seat is a group of keyboards, pointer and touch devices. This
object is published as a global during start up, or when such a
@@ -1252,6 +1252,7 @@
<entry name="pointer" value="1" summary="The seat has pointer devices"/>
<entry name="keyboard" value="2" summary="The seat has one or more keyboards"/>
<entry name="touch" value="4" summary="The seat has touch devices"/>
+ <entry name="pointer_lock" value="8" summary="lock pointer"/>
</enum>
<event name="capabilities">
@@ -1307,6 +1308,40 @@
<arg name="name" type="string"/>
</event>
+
+ <request name="lock_pointer" since="4">
+ <description summary="return pointer object">
+ The lock_pointer request lets the client disable pointer
+ motion and request relative motion events.
+
+ This request initializes the pointer lock and activates it in
+ case the surface is active. If the surface isn't active when
+ the server receives the request, the compositor will activate
+ the pointer_lock when the surface is eventually activated.
+
+ The lock_pointer request will create a new wl_pointer object.
+ When the pointer_lock is activated, the regular wl_seat
+ pointer send out a leave event and the pointer_lock wl_pointer
+ object will receive an enter event. The enter event will
+ indicate the position of the pointer at the time of
+ activation. While the pointer lock is active, the wl_pointer
+ object will send out motion events, but the coordinates
+ correspond to relative pointer motion.
+
+ The compositor can break the pointer_lock at any time, for
+ example when switching to a different application (eg,
+ alt-tab), if a notification pops up or when the screensaver
+ starts. When this happens the pointer lock wl_pointer will
+ send a leave event. When or if the server activates the
+ surface again, the client will receive an enter event again.
+
+ The client can break the pointer lock at any time by releasing
+ the pointer lock wl_pointer using the wl_pointer.release request.
+ </description>
+ <arg name="id" type="new_id" interface="wl_pointer"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+
</interface>
<interface name="wl_pointer" version="3">