gdk/wayland: Stop storing the last serial in GdkWaylandDisplay
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 18 Jul 2022 10:50:39 +0000 (12:50 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 18 Jul 2022 13:21:40 +0000 (15:21 +0200)
This is not used anymore, so we can drop the serial being stored
here.

gdk/wayland/gdkdevice-wayland.c
gdk/wayland/gdkdisplay-wayland.c
gdk/wayland/gdkdisplay-wayland.h
gdk/wayland/gdkprivate-wayland.h

index 04bf0aa216196a0f945001cce3af698ec8631ecc..e407ce811ec7d2fe070ab13e8107dbcc4de81ed9 100644 (file)
@@ -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);
index 9079c6ddd3d82b9108fef3ca01adcc3477551244..fd2aeee12d00878583c8c2279ecdac417d7009cd 100644 (file)
@@ -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`
index b9ab698c19788c68ad960f0d0f4e42f2331e04ab..8907d2021262bf4ed9c376c46af693246422c157 100644 (file)
@@ -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;
index df072b4f8fda912b4043f6b2e8f24aaa5402dcec..ca795dd4636c6e5a84652160f5fbe5be9c93a744 100644 (file)
@@ -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,