[gtk/matthiasc/for-master: 2/2] wayland: Fix release build warnings



commit 77ce68b44fe3fc607eda820b64d8452cd116ea1d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 18 02:34:56 2020 -0500

    wayland: Fix release build warnings

 gdk/wayland/gdkdevice-wayland.c  | 169 ++++++++++++++++-----------------------
 gdk/wayland/gdkdisplay-wayland.c |   7 +-
 gdk/wayland/gdkdrop-wayland.c    |   6 +-
 3 files changed, 79 insertions(+), 103 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 24573ae16f..355dae8beb 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -56,6 +56,8 @@
 #define BTN_STYLUS3 0x149 /* Linux 4.15 */
 #endif
 
+#define GDK_SEAT_NOTE(seat,type,action) GDK_DISPLAY_NOTE(gdk_seat_get_display (GDK_SEAT (seat)),type,action)
+
 typedef struct _GdkWaylandDevicePad GdkWaylandDevicePad;
 typedef struct _GdkWaylandDevicePadClass GdkWaylandDevicePadClass;
 
@@ -1119,7 +1121,7 @@ data_offer_offer (void                 *data,
 
   if (seat->pending_offer != offer)
     {
-      GDK_DISPLAY_NOTE (gdk_seat_get_display (GDK_SEAT (seat)), EVENTS,
+      GDK_SEAT_NOTE (seat, EVENTS,
                         g_message ("%p: offer for unknown offer %p of %s",
                                    seat, offer, type));
       return;
@@ -1191,7 +1193,7 @@ data_device_data_offer (void                  *data,
 {
   GdkWaylandSeat *seat = data;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("data device data offer, data device %p, offer %p",
                        data_device, offer));
 
@@ -1228,13 +1230,13 @@ data_device_enter (void                  *data,
 
   if (offer != seat->pending_offer)
     {
-      GDK_DISPLAY_NOTE (gdk_seat_get_display (GDK_SEAT (seat)), EVENTS,
+      GDK_SEAT_NOTE (seat, EVENTS,
                         g_message ("%p: enter event for unknown offer %p, expected %p",
                                    seat, offer, seat->pending_offer));
       return;
     }
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("data device enter, data device %p serial %u, surface %p, x %f y %f, offer %p",
                        data_device, serial, surface, wl_fixed_to_double (x), wl_fixed_to_double (y), offer));
 
@@ -1274,7 +1276,7 @@ data_device_leave (void                  *data,
 {
   GdkWaylandSeat *seat = data;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("data device leave, data device %p", data_device));
 
   if (seat->drop == NULL)
@@ -1300,7 +1302,7 @@ data_device_motion (void                  *data,
   GdkWaylandSeat *seat = data;
   int origin_x, origin_y;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("data device motion, data_device = %p, time = %d, x = %f, y = %f",
                        data_device, time, wl_fixed_to_double (x), wl_fixed_to_double (y)));
 
@@ -1327,7 +1329,7 @@ data_device_drop (void                  *data,
   GdkWaylandSeat *seat = data;
   int origin_x, origin_y;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("data device drop, data device %p", data_device));
 
   gdk_surface_get_origin (gdk_drop_get_surface (seat->drop), &origin_x, &origin_y);
@@ -1573,7 +1575,7 @@ pointer_handle_enter (void              *data,
                    &event->crossing.x_root,
                    &event->crossing.y_root);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("enter, seat %p surface %p",
                        seat, seat->pointer_info.focus));
 
@@ -1621,7 +1623,7 @@ pointer_handle_leave (void              *data,
                    &event->crossing.x_root,
                    &event->crossing.y_root);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("leave, seat %p surface %p",
                        seat, seat->pointer_info.focus));
 
@@ -1667,7 +1669,7 @@ pointer_handle_motion (void              *data,
                    &event->motion.x_root,
                    &event->motion.y_root);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("motion %f %f, seat %p state %d",
                        wl_fixed_to_double (sx), wl_fixed_to_double (sy),
                       seat, event->motion.state));
@@ -1740,7 +1742,7 @@ pointer_handle_button (void              *data,
   else
     seat->pointer_info.button_modifiers &= ~modifier;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
            g_message ("button %d %s, seat %p state %d",
                       event->button.button,
                       state ? "press" : "release",
@@ -1798,7 +1800,7 @@ pointer_handle_axis (void              *data,
 
   seat->pointer_info.time = time;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("scroll, axis %s, value %f, seat %p",
                        get_axis_name (axis), wl_fixed_to_double (value) / 10.0,
                        seat));
@@ -1813,7 +1815,7 @@ pointer_handle_frame (void              *data,
 {
   GdkWaylandSeat *seat = data;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("frame, seat %p", seat));
 
   gdk_wayland_seat_flush_frame_event (seat);
@@ -1854,7 +1856,7 @@ pointer_handle_axis_source (void                        *data,
 
   pointer_frame->source = source;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("axis source %s, seat %p", get_axis_source_name (source), seat));
 }
 
@@ -1886,7 +1888,7 @@ pointer_handle_axis_stop (void              *data,
 
   pointer_frame->is_scroll_stop = TRUE;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("axis %s stop, seat %p", get_axis_name (axis), seat));
 }
 
@@ -1914,7 +1916,7 @@ pointer_handle_axis_discrete (void              *data,
       g_return_if_reached ();
     }
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("discrete scroll, axis %s, value %d, seat %p",
                        get_axis_name (axis), value, seat));
 }
@@ -1970,7 +1972,7 @@ keyboard_handle_enter (void               *data,
   gdk_event_set_device (event, seat->master_keyboard);
   gdk_event_set_source_device (event, seat->keyboard);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("focus in, seat %p surface %p",
                        seat, seat->keyboard_focus));
 
@@ -2011,7 +2013,7 @@ keyboard_handle_leave (void               *data,
   seat->keyboard_focus = NULL;
   seat->repeat_key = 0;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("focus out, seat %p surface %p",
                        seat, event->any.surface));
 
@@ -2106,7 +2108,7 @@ deliver_key_event (GdkWaylandSeat *seat,
 
   _gdk_wayland_display_deliver_event (seat->display, event);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("keyboard %s event%s, surface %p, code %d, sym %d, "
                        "mods 0x%x",
                        (state ? "press" : "release"),
@@ -2394,7 +2396,7 @@ touch_handle_down (void              *data,
       mimic_pointer_emulating_touch_info (seat->touch_master, touch);
     }
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("touch begin %f %f", event->touch.x, event->touch.y));
 
   _gdk_wayland_display_deliver_event (seat->display, event);
@@ -2417,7 +2419,7 @@ touch_handle_up (void            *data,
   touch = gdk_wayland_seat_get_touch (seat, id);
   event = _create_touch_event (seat, touch, GDK_TOUCH_END, time);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("touch end %f %f", event->touch.x, event->touch.y));
 
   _gdk_wayland_display_deliver_event (seat->display, event);
@@ -2449,7 +2451,7 @@ touch_handle_motion (void            *data,
 
   event = _create_touch_event (seat, touch, GDK_TOUCH_UPDATE, time);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("touch update %f %f", event->touch.x, event->touch.y));
 
   _gdk_wayland_display_deliver_event (seat->display, event);
@@ -2486,7 +2488,7 @@ touch_handle_cancel (void            *data,
       g_hash_table_iter_remove (&iter);
     }
 
-  GDK_DISPLAY_NOTE (wayland_seat->display, EVENTS, g_message ("touch cancel"));
+  GDK_SEAT_NOTE (wayland_seat, EVENTS, g_message ("touch cancel"));
 }
 
 static void
@@ -2522,7 +2524,7 @@ emit_gesture_swipe_event (GdkWaylandSeat          *seat,
                    &event->touchpad_swipe.x_root,
                    &event->touchpad_swipe.y_root);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("swipe event %d, coords: %f %f, seat %p state %d",
                        event->any.type, event->touchpad_swipe.x,
                        event->touchpad_swipe.y, seat,
@@ -2625,7 +2627,7 @@ emit_gesture_pinch_event (GdkWaylandSeat          *seat,
                    &event->touchpad_pinch.x_root,
                    &event->touchpad_pinch.y_root);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("pinch event %d, coords: %f %f, seat %p state %d",
                        event->any.type, event->touchpad_pinch.x,
                        event->touchpad_pinch.y, seat,
@@ -2951,7 +2953,7 @@ seat_handle_capabilities (void                    *data,
   GdkWaylandSeat *seat = data;
   GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
 
-  GDK_DISPLAY_NOTE (seat->display, MISC,
+  GDK_SEAT_NOTE (seat, MISC,
             g_message ("seat %p with %s%s%s", wl_seat,
                        (caps & WL_SEAT_CAPABILITY_POINTER) ? " pointer, " : "",
                        (caps & WL_SEAT_CAPABILITY_KEYBOARD) ? " keyboard, " : "",
@@ -3174,7 +3176,7 @@ seat_handle_name (void           *data,
                   const char     *name)
 {
   /* We don't care about the name. */
-  GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (data)->display, MISC,
+  GDK_SEAT_NOTE (GDK_WAYLAND_SEAT (data), MISC,
             g_message ("seat %p name %s", seat, name));
 }
 
@@ -3488,7 +3490,7 @@ tablet_tool_handle_proximity_in (void                      *data,
                     gdk_wayland_surface_get_wl_output (surface));
   pointer_surface_update_scale (tablet->master);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("proximity in, seat %p surface %p tool %d",
                        seat, tablet->pointer_info.focus,
                        gdk_device_tool_get_tool_type (tool->tool)));
@@ -3500,10 +3502,9 @@ tablet_tool_handle_proximity_out (void                      *data,
 {
   GdkWaylandTabletToolData *tool = data;
   GdkWaylandTabletData *tablet = tool->current_tablet;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
   GdkEvent *event;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (tool->seat, EVENTS,
             g_message ("proximity out, seat %p, tool %d", seat,
                        gdk_device_tool_get_tool_type (tool->tool)));
 
@@ -3600,7 +3601,7 @@ tablet_tool_handle_motion (void                      *data,
   tablet->pointer_info.surface_x = wl_fixed_to_double (sx);
   tablet->pointer_info.surface_y = wl_fixed_to_double (sy);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("tablet motion %f %f",
                        tablet->pointer_info.surface_x,
                        tablet->pointer_info.surface_y));
@@ -3633,7 +3634,7 @@ tablet_tool_handle_pressure (void                      *data,
   _gdk_device_translate_axis (tablet->current_device, axis_index,
                               pressure, &tablet->axes[axis_index]);
 
-  GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
+  GDK_SEAT_NOTE (tool->seat, EVENTS,
             g_message ("tablet tool %d pressure %d",
                        gdk_device_tool_get_tool_type (tool->tool), pressure));
 }
@@ -3650,7 +3651,7 @@ tablet_tool_handle_distance (void                      *data,
   _gdk_device_translate_axis (tablet->current_device, axis_index,
                               distance, &tablet->axes[axis_index]);
 
-  GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
+  GDK_SEAT_NOTE (tool->seat, EVENTS,
             g_message ("tablet tool %d distance %d",
                        gdk_device_tool_get_tool_type (tool->tool), distance));
 }
@@ -3673,7 +3674,7 @@ tablet_tool_handle_tilt (void                      *data,
                               wl_fixed_to_double (ytilt),
                               &tablet->axes[ytilt_axis_index]);
 
-  GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
+  GDK_SEAT_NOTE (tool->seat, EVENTS,
             g_message ("tablet tool %d tilt %f/%f",
                        gdk_device_tool_get_tool_type (tool->tool),
                        wl_fixed_to_double (xtilt), wl_fixed_to_double (ytilt)));
@@ -3728,7 +3729,7 @@ tablet_tool_handle_rotation (void                      *data,
                               wl_fixed_to_double (degrees),
                               &tablet->axes[axis_index]);
 
-  GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
+  GDK_SEAT_NOTE (tool->seat, EVENTS,
             g_message ("tablet tool %d rotation %f",
                        gdk_device_tool_get_tool_type (tool->tool),
                        wl_fixed_to_double (degrees)));
@@ -3746,7 +3747,7 @@ tablet_tool_handle_slider (void                      *data,
   _gdk_device_translate_axis (tablet->current_device, axis_index,
                               position, &tablet->axes[axis_index]);
 
-  GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
+  GDK_SEAT_NOTE (tool->seat, EVENTS,
             g_message ("tablet tool %d slider %d",
                        gdk_device_tool_get_tool_type (tool->tool), position));
 }
@@ -3762,7 +3763,7 @@ tablet_tool_handle_wheel (void                      *data,
   GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
   GdkEvent *event;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("tablet tool %d wheel %d/%d",
                        gdk_device_tool_get_tool_type (tool->tool), degrees, clicks));
 
@@ -3792,10 +3793,9 @@ tablet_tool_handle_frame (void                      *data,
 {
   GdkWaylandTabletToolData *tool = data;
   GdkWaylandTabletData *tablet = tool->current_tablet;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
   GdkEvent *frame_event;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (tablet->seat, EVENTS,
             g_message ("tablet frame, time %d", time));
 
   frame_event = tablet->pointer_info.frame.event;
@@ -3838,10 +3838,8 @@ tablet_pad_ring_handle_source (void                          *data,
                                uint32_t                       source)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (group->pad->seat, EVENTS,
             g_message ("tablet pad ring handle source, ring = %p source = %d",
                        wp_tablet_pad_ring, source));
 
@@ -3854,10 +3852,8 @@ tablet_pad_ring_handle_angle (void                          *data,
                               wl_fixed_t                     angle)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (grou->pad->seat, EVENTS,
             g_message ("tablet pad ring handle angle, ring = %p angle = %f",
                        wp_tablet_pad_ring, wl_fixed_to_double (angle)));
 
@@ -3869,10 +3865,8 @@ tablet_pad_ring_handle_stop (void                          *data,
                              struct zwp_tablet_pad_ring_v2 *wp_tablet_pad_ring)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (group->pad->seat, EVENTS,
             g_message ("tablet pad ring handle stop, ring = %p", wp_tablet_pad_ring));
 
   group->axis_tmp_info.is_stop = TRUE;
@@ -3888,7 +3882,7 @@ tablet_pad_ring_handle_frame (void                          *data,
   GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
   GdkEvent *event;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("tablet pad ring handle frame, ring = %p", wp_tablet_pad_ring));
 
   event = gdk_event_new (GDK_PAD_RING);
@@ -3918,10 +3912,8 @@ tablet_pad_strip_handle_source (void                           *data,
                                 uint32_t                        source)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (grou->pad->seat, EVENTS,
             g_message ("tablet pad strip handle source, strip = %p source = %d",
                        wp_tablet_pad_strip, source));
 
@@ -3934,10 +3926,8 @@ tablet_pad_strip_handle_position (void                           *data,
                                   uint32_t                        position)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (group->pad->seat, EVENTS,
             g_message ("tablet pad strip handle position, strip = %p position = %d",
                        wp_tablet_pad_strip, position));
 
@@ -3949,10 +3939,8 @@ tablet_pad_strip_handle_stop (void                           *data,
                               struct zwp_tablet_pad_strip_v2 *wp_tablet_pad_strip)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (goup->pad->seat, EVENTS,
             g_message ("tablet pad strip handle stop, strip = %p",
                        wp_tablet_pad_strip));
 
@@ -3969,7 +3957,7 @@ tablet_pad_strip_handle_frame (void                           *data,
   GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
   GdkEvent *event;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("tablet pad strip handle frame, strip = %p",
                        wp_tablet_pad_strip));
 
@@ -4001,11 +3989,9 @@ tablet_pad_group_handle_buttons (void                           *data,
                                  struct wl_array                *buttons)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
   uint32_t *p;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (group->pad->seat, EVENTS,
             g_message ("tablet pad group handle buttons, pad group = %p, n_buttons = %" G_GSIZE_FORMAT,
                        wp_tablet_pad_group, buttons->size));
 
@@ -4023,10 +4009,8 @@ tablet_pad_group_handle_ring (void                           *data,
                               struct zwp_tablet_pad_ring_v2  *wp_tablet_pad_ring)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (group->pad->seat, EVENTS,
             g_message ("tablet pad group handle ring, pad group = %p, ring = %p",
                        wp_tablet_pad_group, wp_tablet_pad_ring));
 
@@ -4044,10 +4028,8 @@ tablet_pad_group_handle_strip (void                           *data,
                                struct zwp_tablet_pad_strip_v2 *wp_tablet_pad_strip)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (group->pad->seat, EVENTS,
             g_message ("tablet pad group handle strip, pad group = %p, strip = %p",
                        wp_tablet_pad_group, wp_tablet_pad_strip));
 
@@ -4065,10 +4047,8 @@ tablet_pad_group_handle_modes (void                           *data,
                                uint32_t                        modes)
 {
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (group->pad->seat, EVENTS,
             g_message ("tablet pad group handle modes, pad group = %p, n_modes = %d",
                        wp_tablet_pad_group, modes));
 
@@ -4079,11 +4059,11 @@ static void
 tablet_pad_group_handle_done (void                           *data,
                               struct zwp_tablet_pad_group_v2 *wp_tablet_pad_group)
 {
+#ifdef G_ENABLE_DEBUG
   GdkWaylandTabletPadGroupData *group = data;
-  GdkWaylandTabletPadData *pad = group->pad;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
+#endif
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (group->pad->seat, EVENTS,
             g_message ("tablet pad group handle done, pad group = %p",
                        wp_tablet_pad_group));
 }
@@ -4101,7 +4081,7 @@ tablet_pad_group_handle_mode (void                           *data,
   GdkEvent *event;
   guint n_group;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("tablet pad group handle mode, pad group = %p, mode = %d",
                        wp_tablet_pad_group, mode));
 
@@ -4137,9 +4117,8 @@ tablet_pad_handle_group (void                           *data,
 {
   GdkWaylandTabletPadData *pad = data;
   GdkWaylandTabletPadGroupData *group;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (pad->seat, EVENTS,
             g_message ("tablet pad handle group, pad group = %p, group = %p",
                        wp_tablet_pad_group, wp_tablet_pad_group));
 
@@ -4159,9 +4138,8 @@ tablet_pad_handle_path (void                     *data,
                         const char               *path)
 {
   GdkWaylandTabletPadData *pad = data;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (pad->seat, EVENTS,
             g_message ("tablet pad handle path, pad = %p, path = %s",
                        wp_tablet_pad, path));
 
@@ -4174,9 +4152,8 @@ tablet_pad_handle_buttons (void                     *data,
                            uint32_t                  buttons)
 {
   GdkWaylandTabletPadData *pad = data;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (pad->seat, EVENTS,
             g_message ("tablet pad handle buttons, pad = %p, n_buttons = %d",
                        wp_tablet_pad, buttons));
 
@@ -4188,9 +4165,8 @@ tablet_pad_handle_done (void                     *data,
                         struct zwp_tablet_pad_v2 *wp_tablet_pad)
 {
   GdkWaylandTabletPadData *pad = data;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (pad->seat, EVENTS,
             g_message ("tablet pad handle done, pad = %p", wp_tablet_pad));
 
   pad->device =
@@ -4200,11 +4176,11 @@ tablet_pad_handle_done (void                     *data,
                   "input-source", GDK_SOURCE_TABLET_PAD,
                   "input-mode", GDK_MODE_SCREEN,
                   "display", gdk_seat_get_display (pad->seat),
-                  "seat", seat,
+                  "seat", pad->seat,
                   NULL);
 
-  _gdk_device_set_associated_device (pad->device, seat->master_keyboard);
-  gdk_seat_device_added (GDK_SEAT (seat), pad->device);
+  _gdk_device_set_associated_device (pad->device, GDK_WAYLAND_SEAT (pad->seat)->master_keyboard);
+  gdk_seat_device_added (GDK_SEAT (pad->seat), pad->device);
 }
 
 static void
@@ -4216,11 +4192,10 @@ tablet_pad_handle_button (void                     *data,
 {
   GdkWaylandTabletPadData *pad = data;
   GdkWaylandTabletPadGroupData *group;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
   GdkEvent *event;
   gint n_group;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (pad->seat, EVENTS,
             g_message ("tablet pad handle button, pad = %p, button = %d, state = %d",
                        wp_tablet_pad, button, state));
 
@@ -4230,7 +4205,7 @@ tablet_pad_handle_button (void                     *data,
   event = gdk_event_new (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ?
                          GDK_PAD_BUTTON_PRESS :
                          GDK_PAD_BUTTON_RELEASE);
-  g_set_object (&event->any.surface, seat->keyboard_focus);
+  g_set_object (&event->any.surface, GDK_WAYLAND_SEAT (pad->seat)->keyboard_focus);
   event->pad_button.button = button;
   event->pad_button.group = n_group;
   event->pad_button.mode = group->current_mode;
@@ -4238,8 +4213,7 @@ tablet_pad_handle_button (void                     *data,
   gdk_event_set_device (event, pad->device);
   gdk_event_set_source_device (event, pad->device);
 
-  _gdk_wayland_display_deliver_event (gdk_seat_get_display (pad->seat),
-                                      event);
+  _gdk_wayland_display_deliver_event (gdk_seat_get_display (pad->seat), event);
 }
 
 static void
@@ -4250,10 +4224,9 @@ tablet_pad_handle_enter (void                     *data,
                          struct wl_surface        *surface)
 {
   GdkWaylandTabletPadData *pad = data;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
   GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (pad->seat, EVENTS,
             g_message ("tablet pad handle enter, pad = %p, tablet = %p surface = %p",
                        wp_tablet_pad, wp_tablet, surface));
 
@@ -4269,9 +4242,8 @@ tablet_pad_handle_leave (void                     *data,
                          struct wl_surface        *surface)
 {
   GdkWaylandTabletPadData *pad = data;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (pad->seat, EVENTS,
             g_message ("tablet pad handle leave, pad = %p, surface = %p",
                        wp_tablet_pad, surface));
 
@@ -4287,9 +4259,8 @@ tablet_pad_handle_removed (void                     *data,
                            struct zwp_tablet_pad_v2 *wp_tablet_pad)
 {
   GdkWaylandTabletPadData *pad = data;
-  GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (pad->seat, EVENTS,
             g_message ("tablet pad handle removed, pad = %p", wp_tablet_pad));
 
   /* Remove from the current tablet */
@@ -4461,7 +4432,7 @@ pointer_surface_enter (void              *data,
   GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
   GdkWaylandTabletData *tablet;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("pointer surface of seat %p entered output %p",
                        seat, output));
 
@@ -4490,7 +4461,7 @@ pointer_surface_leave (void              *data,
   GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
   GdkWaylandTabletData *tablet;
 
-  GDK_DISPLAY_NOTE (seat->display, EVENTS,
+  GDK_SEAT_NOTE (seat, EVENTS,
             g_message ("pointer surface of seat %p left output %p",
                        seat, output));
 
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 56ba3d1134..0f96d99b61 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -2307,10 +2307,11 @@ xdg_output_handle_description (void                  *data,
                                struct zxdg_output_v1 *xdg_output,
                                const char            *description)
 {
-  GdkWaylandMonitor *monitor = (GdkWaylandMonitor *) data;
-
   GDK_NOTE (MISC,
-            g_message ("handle description xdg-output %d", monitor->id));
+            {
+              GdkWaylandMonitor *monitor = (GdkWaylandMonitor *) data;
+              g_message ("handle description xdg-output %d", monitor->id)
+            });
 }
 
 static const struct zxdg_output_v1_listener xdg_output_listener = {
diff --git a/gdk/wayland/gdkdrop-wayland.c b/gdk/wayland/gdkdrop-wayland.c
index c0c82036dd..3743a2d3ca 100644
--- a/gdk/wayland/gdkdrop-wayland.c
+++ b/gdk/wayland/gdkdrop-wayland.c
@@ -181,21 +181,25 @@ gdk_wayland_drop_read_async (GdkDrop             *drop,
                              gpointer             user_data)
 {
   GdkWaylandDrop *wayland_drop = GDK_WAYLAND_DROP (drop);
+#ifdef G_ENABLE_DEBUG
   GdkDisplay *display;
+#endif
   GInputStream *stream;
   const char *mime_type;
   int pipe_fd[2];
   GError *error = NULL;
   GTask *task;
 
-  display = gdk_drop_get_display (drop),
   task = g_task_new (drop, cancellable, callback, user_data);
   g_task_set_priority (task, io_priority);
   g_task_set_source_tag (task, gdk_wayland_drop_read_async);
 
+#ifdef G_ENABLE_DEBUG
+  display = gdk_drop_get_display (drop),
   GDK_DISPLAY_NOTE (display, DND, char *s = gdk_content_formats_to_string (formats);
                     g_message ("%p: read for %s", drop, s);
                     g_free (s); );
+#endif
   mime_type = gdk_content_formats_match_mime_type (formats,
                                                    gdk_drop_get_formats (drop));
   if (mime_type == NULL)


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