[PATCH] Wayland: Add wl_pointer.buttons_update()

Martin Minarik minarik11 at student.fiit.stuba.sk
Mon Jun 10 11:25:42 PDT 2013


Extend the wl_pointer protocol, to enable:
* Hot plugging/unplugging an input device with already held keys.
* Handling an input lag gracefully.
* Provide a way to deliver the state of all buttons when focusing a surface.
---
 protocol/wayland.xml |   34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 5129200..f185c5d 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -1233,7 +1233,7 @@
     </request>
   </interface>
 
-  <interface name="wl_pointer" version="1">
+  <interface name="wl_pointer" version="2">
     <description summary="pointer input device">
       The wl_pointer interface represents one or more input devices,
       such as mice, which control the pointer location and pointer_focus
@@ -1379,6 +1379,38 @@
       <arg name="axis" type="uint"/>
       <arg name="value" type="fixed"/>
     </event>
+
+    <!-- Version 2 additions -->
+
+    <enum name="button_update">
+      <description summary="update of the button state">
+	Describes how the state changed for one or a multiple buttons which
+	provoked this button event.
+      </description>
+      <entry name="released" value="0" summary="the buttons have been released"/>
+      <entry name="pressed" value="1" summary="the buttons have been clicked"/>
+    </enum>
+
+    <event name="buttons_update">
+      <description summary="buttons update event">
+	When the compositor first discovers that the state of one or multiple
+	buttons is different, it delivers this event. The exact time when the
+	click or release occured is undefined, hovewer it is known to be prior
+	to this timestamp.
+	The timestamp represents the time, when the compositor detected a
+	changed button state.
+
+	The client is recommended to handle this event a bit more carefully than
+	a normal button click or release. In particular, by depressing or
+	releasing the UI elements without triggering the associated action,
+	if feasible. If this is unfeasible, the client can handle this exactly
+	like calling a button event on every item in the buttons array.
+      </description>
+      <arg name="serial" type="uint"/>
+      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+      <arg name="buttons" type="array" summary="the set of affected buttons"/>
+      <arg name="update" type="uint"/>
+    </event>
   </interface>
 
   <interface name="wl_keyboard" version="2">
-- 
1.7.10.4



More information about the wayland-devel mailing list