[gtk+] Make sure events have displays



commit 9b2936922257a37c4cedfa09034b88bd5984416c
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 12 23:21:26 2017 -0500

    Make sure events have displays
    
    This seems to be necessary if you want to call
    gdk_display_put_event on them.

 gdk/wayland/gdkselection-wayland.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c
index 8f69bee..4634033 100644
--- a/gdk/wayland/gdkselection-wayland.c
+++ b/gdk/wayland/gdkselection-wayland.c
@@ -108,6 +108,14 @@ static void async_write_data_write (AsyncWriteData *write_data);
 static void emit_selection_clear (GdkDisplay *display, GdkAtom selection);
 
 static void
+_gdk_display_put_event (GdkDisplay *display,
+                        GdkEvent   *event)
+{
+  gdk_event_set_display (event, display);
+  gdk_display_put_event (display, event);
+}
+
+static void
 selection_buffer_notify (SelectionBuffer *buffer)
 {
   GdkEvent *event;
@@ -124,7 +132,7 @@ selection_buffer_notify (SelectionBuffer *buffer)
       event->selection.time = GDK_CURRENT_TIME;
       event->selection.requestor = g_object_ref (l->data);
 
-      gdk_display_put_event (gdk_window_get_display (l->data), event);
+      _gdk_display_put_event (gdk_window_get_display (l->data), event);
       gdk_event_free (event);
     }
 }
@@ -563,7 +571,7 @@ gdk_wayland_selection_emit_request (GdkWindow *window,
   event->selection.time = GDK_CURRENT_TIME;
   event->selection.requestor = g_object_ref (window);
 
-  gdk_display_put_event (gdk_window_get_display (window), event);
+  _gdk_display_put_event (gdk_window_get_display (window), event);
   gdk_event_free (event);
 }
 
@@ -1096,7 +1104,7 @@ emit_empty_selection_notify (GdkWindow *requestor,
   event->selection.time = GDK_CURRENT_TIME;
   event->selection.requestor = g_object_ref (requestor);
 
-  gdk_display_put_event (gdk_window_get_display (requestor), event);
+  _gdk_display_put_event (gdk_window_get_display (requestor), event);
   gdk_event_free (event);
 }
 
@@ -1118,7 +1126,7 @@ emit_selection_clear (GdkDisplay *display,
       event->selection.requestor = g_object_ref (window);
     }
 
-  gdk_display_put_event (display, event);
+  _gdk_display_put_event (display, event);
   gdk_event_free (event);
 }
 


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