[gtk/readonly-events-1: 140/149] Stop exporting check_event_sanity



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

    Stop exporting check_event_sanity

 gdk/gdkevents.c              | 20 +++++++-------------
 gdk/gdkeventsprivate.h       |  2 --
 gdk/wayland/gdkeventsource.c |  3 ---
 3 files changed, 7 insertions(+), 18 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index ac46600a28..e66bbd4fd6 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -68,29 +68,23 @@ 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 (event->any.device != NULL &&
+      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 31bbb165f1..8db92954e8 100644
--- a/gdk/wayland/gdkeventsource.c
+++ b/gdk/wayland/gdkeventsource.c
@@ -170,9 +170,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]