[gtk/wip/carlosg/use-press-serial] gdk/wayland: Stop storing the last serial in GdkWaylandDisplay




commit 95cf34ab4cf716b063062b57d0ca6d2bff5f520b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jul 18 12:50:39 2022 +0200

    gdk/wayland: Stop storing the last serial in GdkWaylandDisplay
    
    This is not used anymore, so we can drop the serial being stored
    here.

 gdk/wayland/gdkdevice-wayland.c  | 46 ++--------------------------------------
 gdk/wayland/gdkdisplay-wayland.c | 17 ---------------
 gdk/wayland/gdkdisplay-wayland.h |  3 ---
 gdk/wayland/gdkprivate-wayland.h |  4 ----
 4 files changed, 2 insertions(+), 68 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 04bf0aa216..e407ce811e 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1514,8 +1514,6 @@ pointer_handle_enter (void              *data,
   if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
     return;
 
-  _gdk_wayland_display_update_serial (display_wayland, serial);
-
   seat->pointer_info.focus = wl_surface_get_user_data (surface);
   g_object_ref (seat->pointer_info.focus);
 
@@ -1566,7 +1564,6 @@ pointer_handle_leave (void              *data,
   if (!seat->pointer_info.focus)
     return;
 
-  _gdk_wayland_display_update_serial (display_wayland, serial);
   grab = _gdk_display_get_last_device_grab (seat->display,
                                             seat->logical_pointer);
 
@@ -1666,8 +1663,6 @@ pointer_handle_button (void              *data,
   if (!seat->pointer_info.focus)
     return;
 
-  _gdk_wayland_display_update_serial (display, serial);
-
   switch (button)
     {
     case BTN_LEFT:
@@ -1986,7 +1981,6 @@ keyboard_handle_enter (void               *data,
 {
   GdkWaylandSeat *seat = data;
   GdkEvent *event;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
 
   if (!surface)
     return;
@@ -1994,8 +1988,6 @@ keyboard_handle_enter (void               *data,
   if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
     return;
 
-  _gdk_wayland_display_update_serial (display, serial);
-
   seat->keyboard_focus = wl_surface_get_user_data (surface);
   g_object_ref (seat->keyboard_focus);
   seat->repeat_key = 0;
@@ -2021,7 +2013,6 @@ keyboard_handle_leave (void               *data,
 {
   GdkWaylandSeat *seat = data;
   GdkEvent *event;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
 
   if (!seat->keyboard_focus)
     return;
@@ -2032,8 +2023,6 @@ keyboard_handle_leave (void               *data,
    */
   stop_key_repeat (seat);
 
-  _gdk_wayland_display_update_serial (display, serial);
-
   event = gdk_focus_event_new (seat->keyboard_focus,
                                seat->logical_keyboard,
                                FALSE);
@@ -2272,7 +2261,6 @@ keyboard_handle_key (void               *data,
                      uint32_t            state_w)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
 
   if (!seat->keyboard_focus)
     return;
@@ -2280,7 +2268,6 @@ keyboard_handle_key (void               *data,
   seat->keyboard_time = time;
   seat->keyboard_key_serial = serial;
   seat->repeat_count = 0;
-  _gdk_wayland_display_update_serial (display, serial);
   deliver_key_event (data, time, key + 8, state_w, FALSE);
 
 }
@@ -2470,12 +2457,9 @@ touch_handle_down (void              *data,
                    wl_fixed_t         y)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
   GdkWaylandTouchData *touch;
   GdkEvent *event;
 
-  _gdk_wayland_display_update_serial (display, serial);
-
   if (!wl_surface)
     return;
 
@@ -2519,12 +2503,9 @@ touch_handle_up (void            *data,
                  int32_t          id)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
   GdkWaylandTouchData *touch;
   GdkEvent *event;
 
-  _gdk_wayland_display_update_serial (display, serial);
-
   touch = gdk_wayland_seat_get_touch (seat, id);
   if (!touch)
     return;
@@ -2704,9 +2685,6 @@ gesture_swipe_begin (void                                *data,
                      uint32_t                             fingers)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
-
-  _gdk_wayland_display_update_serial (display, serial);
 
   emit_gesture_swipe_event (seat,
                             GDK_TOUCHPAD_GESTURE_PHASE_BEGIN,
@@ -2739,11 +2717,8 @@ gesture_swipe_end (void                                *data,
                    int32_t                              cancelled)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
   GdkTouchpadGesturePhase phase;
 
-  _gdk_wayland_display_update_serial (display, serial);
-
   phase = (cancelled) ?
     GDK_TOUCHPAD_GESTURE_PHASE_CANCEL :
     GDK_TOUCHPAD_GESTURE_PHASE_END;
@@ -2806,9 +2781,7 @@ gesture_pinch_begin (void                                *data,
                      uint32_t                             fingers)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
 
-  _gdk_wayland_display_update_serial (display, serial);
   emit_gesture_pinch_event (seat,
                             GDK_TOUCHPAD_GESTURE_PHASE_BEGIN,
                             time, fingers, 0, 0, 1, 0);
@@ -2843,11 +2816,8 @@ gesture_pinch_end (void                                *data,
                    int32_t                              cancelled)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
   GdkTouchpadGesturePhase phase;
 
-  _gdk_wayland_display_update_serial (display, serial);
-
   phase = (cancelled) ?
     GDK_TOUCHPAD_GESTURE_PHASE_CANCEL :
     GDK_TOUCHPAD_GESTURE_PHASE_END;
@@ -2901,9 +2871,6 @@ gesture_hold_begin (void                               *data,
                     uint32_t                            fingers)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
-
-  _gdk_wayland_display_update_serial (display, serial);
 
   emit_gesture_hold_event (seat,
                            GDK_TOUCHPAD_GESTURE_PHASE_BEGIN,
@@ -2919,11 +2886,8 @@ gesture_hold_end (void                               *data,
                   int32_t                             cancelled)
 {
   GdkWaylandSeat *seat = data;
-  GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
   GdkTouchpadGesturePhase phase;
 
-  _gdk_wayland_display_update_serial (display, serial);
-
   phase = (cancelled) ?
     GDK_TOUCHPAD_GESTURE_PHASE_CANCEL :
     GDK_TOUCHPAD_GESTURE_PHASE_END;
@@ -3630,8 +3594,6 @@ tablet_tool_handle_proximity_in (void                      *data,
 {
   GdkWaylandTabletToolData *tool = data;
   GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
-  GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
   GdkSurface *surface;
   GdkEvent *event;
 
@@ -3648,7 +3610,6 @@ tablet_tool_handle_proximity_in (void                      *data,
   tool->current_tablet = tablet;
   tablet->current_tool = tool;
 
-  _gdk_wayland_display_update_serial (display_wayland, serial);
   tablet->pointer_info.enter_serial = serial;
 
   tablet->pointer_info.focus = g_object_ref (surface);
@@ -3669,9 +3630,9 @@ tablet_tool_handle_proximity_in (void                      *data,
                     gdk_wayland_surface_get_wl_output (surface));
   pointer_surface_update_scale (tablet->logical_device);
 
-  GDK_SEAT_NOTE (seat, EVENTS,
+  GDK_SEAT_NOTE (tablet->seat, EVENTS,
             g_message ("proximity in, seat %p surface %p tool %d",
-                       seat, tablet->pointer_info.focus,
+                       tablet->seat, tablet->pointer_info.focus,
                        gdk_device_tool_get_tool_type (tool->tool)));
 }
 
@@ -3748,13 +3709,10 @@ tablet_tool_handle_down (void                      *data,
 {
   GdkWaylandTabletToolData *tool = data;
   GdkWaylandTabletData *tablet = tool->current_tablet;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
-  GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
 
   if (!tablet || !tablet->pointer_info.focus)
     return;
 
-  _gdk_wayland_display_update_serial (display_wayland, serial);
   tablet->pointer_info.press_serial = serial;
 
   tablet_create_button_event_frame (tablet, GDK_BUTTON_PRESS, GDK_BUTTON_PRIMARY);
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 9079c6ddd3..fd2aeee12d 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -145,10 +145,6 @@ zxdg_shell_v6_ping (void                 *data,
                     struct zxdg_shell_v6 *xdg_shell,
                     uint32_t              serial)
 {
-  GdkWaylandDisplay *display_wayland = data;
-
-  _gdk_wayland_display_update_serial (display_wayland, serial);
-
   GDK_DISPLAY_NOTE (GDK_DISPLAY (data), EVENTS,
             g_message ("ping, shell %p, serial %u\n", xdg_shell, serial));
 
@@ -1124,19 +1120,6 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland)
 
 }
 
-guint32
-_gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland)
-{
-  return display_wayland->serial;
-}
-
-void
-_gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
-                                    guint32            serial)
-{
-  display_wayland->serial = serial;
-}
-
 /**
  * gdk_wayland_display_get_wl_display: (skip)
  * @display: (type GdkWaylandDisplay): a `GdkDisplay`
diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
index b9ab698c19..8907d20212 100644
--- a/gdk/wayland/gdkdisplay-wayland.h
+++ b/gdk/wayland/gdkdisplay-wayland.h
@@ -84,9 +84,6 @@ struct _GdkWaylandDisplay
   /* Startup notification */
   char *startup_notification_id;
 
-  /* Most recent serial */
-  guint32 serial;
-
   uint32_t xdg_wm_base_id;
   int xdg_wm_base_version;
   uint32_t zxdg_shell_v6_id;
diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h
index df072b4f8f..ca795dd463 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -170,10 +170,6 @@ GdkMonitor *gdk_wayland_display_get_monitor_for_output (GdkDisplay       *displa
 void _gdk_wayland_surface_set_grab_seat (GdkSurface      *surface,
                                         GdkSeat        *seat);
 
-guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland);
-void _gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
-                                         guint32            serial);
-
 cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display,
                                                            int                width,
                                                            int                height,


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