[gtk/readonly-events-1: 24/33] Stop exporting check_event_sanity



commit 709cf9aff5940d63169bf2f8a75710f117464fe1
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 20 17:13:21 2020 -0500

    Stop exporting check_event_sanity

 gdk/gdkevents.c              | 19 ++++++-------------
 gdk/gdkeventsprivate.h       |  2 --
 gdk/wayland/gdkeventsource.c |  3 ---
 3 files changed, 6 insertions(+), 18 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index ac46600a28..3ef058a53f 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -68,29 +68,22 @@ G_DEFINE_BOXED_TYPE (GdkEvent, gdk_event,
                      gdk_event_ref,
                      gdk_event_unref)
 
-gboolean
+static gboolean
 check_event_sanity (GdkEvent *event)
 {
-  GdkDisplay *display;
-  GdkSurface *surface;
-  GdkDevice *device;
-
-  display = gdk_event_get_display (event);
-  surface = gdk_event_get_surface (event);
-  device = gdk_event_get_device (event);
-
-  if (surface && display != gdk_surface_get_display (surface))
+  if (gdk_surface_get_display (event->any.surface) != gdk_device_get_display (event->any.device))
     {
       char *type = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event->any.type);
-      g_warning ("Event of type %s with mismatched surface display", type);
+      g_warning ("Event of type %s with mismatched device display", type);
       g_free (type);
       return FALSE;
     }
 
-  if (device && display != gdk_device_get_display (device))
+  if (event->any.source_device != NULL &&
+      gdk_surface_get_display (event->any.surface) != gdk_device_get_display (event->any.source_device))
     {
       char *type = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event->any.type);
-      g_warning ("Event of type %s with mismatched device display", type);
+      g_warning ("Event of type %s with mismatched source device display", type);
       g_free (type);
       return FALSE;
     }
diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h
index 7f7d7ffe73..6505d548d1 100644
--- a/gdk/gdkeventsprivate.h
+++ b/gdk/gdkeventsprivate.h
@@ -534,8 +534,6 @@ union _GdkEvent
   GdkEventPadGroupMode      pad_group_mode;
 };
 
-gboolean       check_event_sanity (GdkEvent *event);
-
 GdkEvent * gdk_event_button_new         (GdkEventType     type,
                                          GdkSurface      *surface,
                                          GdkDevice       *device,
diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c
index 04ca9cbe61..d910a918e2 100644
--- a/gdk/wayland/gdkeventsource.c
+++ b/gdk/wayland/gdkeventsource.c
@@ -151,9 +151,6 @@ _gdk_wayland_display_deliver_event (GdkDisplay *display,
 {
   GList *node;
 
-  if (!check_event_sanity (event))
-    g_warning ("Snap! delivering insane events\n");
-
   node = _gdk_event_queue_append (display, event);
   _gdk_windowing_got_event (display, node, event,
                             _gdk_display_get_next_serial (display));


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