diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index c50d09c8a1..c4407a6472 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -637,3 +637,17 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display) w, wayland_display->shm); } + +guint32 +_gdk_wayland_display_get_serial (GdkWaylandDisplay *wayland_display) +{ + return wayland_display->serial; +} + +void +_gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display, + guint32 serial) +{ + if (serial > wayland_display->serial) + wayland_display->serial = serial; +} diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h index 00f3a399cb..8b6dd5cc2f 100644 --- a/gdk/wayland/gdkdisplay-wayland.h +++ b/gdk/wayland/gdkdisplay-wayland.h @@ -70,8 +70,9 @@ struct _GdkWaylandDisplay /* Startup notification */ gchar *startup_notification_id; - /* Time of most recent user interaction. */ + /* Time of most recent user interaction and most recent serial */ gulong user_time; + guint32 serial; /* Wayland fields below */ struct wl_display *wl_display; diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h index 59cd1734a1..6b4d3b8a2d 100644 --- a/gdk/wayland/gdkprivate-wayland.h +++ b/gdk/wayland/gdkprivate-wayland.h @@ -155,4 +155,7 @@ void _gdk_wayland_window_set_device_grabbed (GdkWindow *window, struct wl_seat *seat, guint32 time_); +guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *wayland_display); +void _gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display, guint32 serial); + #endif /* __GDK_PRIVATE_WAYLAND_H__ */