[mutter/gnome-3-22] wayland/input-device: Add next serial helper



commit aeeffbe1f78c76d6b74f43ed9cdebf980da09666
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Oct 11 22:29:11 2016 +0800

    wayland/input-device: Add next serial helper
    
    Add a helper function for getting the next input device serial number.
    Will be used by keyboard, pointer and touch devices.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771646

 src/wayland/meta-wayland-input-device.c |   12 ++++++++++++
 src/wayland/meta-wayland-input-device.h |    3 +++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-input-device.c b/src/wayland/meta-wayland-input-device.c
index 92d6fbb..b82f204 100644
--- a/src/wayland/meta-wayland-input-device.c
+++ b/src/wayland/meta-wayland-input-device.c
@@ -26,6 +26,10 @@
 
 #include "wayland/meta-wayland-input-device.h"
 
+#include <wayland-server.h>
+
+#include "wayland/meta-wayland-seat.h"
+
 enum
 {
   PROP_0,
@@ -51,6 +55,14 @@ meta_wayland_input_device_get_seat (MetaWaylandInputDevice *input_device)
   return priv->seat;
 }
 
+uint32_t
+meta_wayland_input_device_next_serial (MetaWaylandInputDevice *input_device)
+{
+  MetaWaylandSeat *seat = meta_wayland_input_device_get_seat (input_device);
+
+  return wl_display_next_serial (seat->wl_display);
+}
+
 static void
 meta_wayland_input_device_set_property (GObject      *object,
                                         guint         prop_id,
diff --git a/src/wayland/meta-wayland-input-device.h b/src/wayland/meta-wayland-input-device.h
index eec5678..c6a6c3d 100644
--- a/src/wayland/meta-wayland-input-device.h
+++ b/src/wayland/meta-wayland-input-device.h
@@ -26,6 +26,7 @@
 #define META_WAYLAND_INPUT_DEVICE_H
 
 #include <glib-object.h>
+#include <stdint.h>
 
 #include "wayland/meta-wayland-types.h"
 
@@ -42,4 +43,6 @@ struct _MetaWaylandInputDeviceClass
 
 MetaWaylandSeat * meta_wayland_input_device_get_seat (MetaWaylandInputDevice *input_device);
 
+uint32_t meta_wayland_input_device_next_serial (MetaWaylandInputDevice *input_device);
+
 #endif /* META_WAYLAND_INPUT_DEVICE_H */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]