[gtk+/wip/carlosg/private-event-structs] clipboard: Use GdkEvent API



commit a3c411b5b8c23a89c104ac53e318500219796890
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 26 14:29:31 2017 -0400

    clipboard: Use GdkEvent API

 gtk/gtkclipboard.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index b46e3b0..329299e 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -416,7 +416,11 @@ static gboolean
 selection_clear_event_cb (GtkWidget        *widget,
                          GdkEventSelection *event)
 {
-  GtkClipboard *clipboard = gtk_widget_get_clipboard (widget, event->selection);
+  GdkAtom selection;
+  GtkClipboard *clipboard;
+
+  gdk_event_get_selection ((GdkEvent *)event, &selection);
+  clipboard = gtk_widget_get_clipboard (widget, selection);
 
   if (clipboard)
     {
@@ -2018,10 +2022,12 @@ void
 _gtk_clipboard_handle_event (GdkEventOwnerChange *event)
 {
   GdkDisplay *display;
+  GdkAtom selection;
   GtkClipboard *clipboard;
   
-  display = gdk_window_get_display (event->window);
-  clipboard = clipboard_peek (display, event->selection, TRUE);
+  gdk_event_get_selection ((GdkEvent *)event, &selection);
+  display = gdk_window_get_display (gdk_event_get_window ((GdkEvent *)event));
+  clipboard = clipboard_peek (display, selection, TRUE);
       
   if (clipboard)
     g_signal_emit (clipboard, 
@@ -2110,7 +2116,10 @@ gtk_clipboard_selection_notify (GtkWidget         *widget,
                                GdkEventSelection *event,
                                GtkClipboard      *clipboard)
 {
-  if (event->selection == gdk_atom_intern_static_string ("CLIPBOARD_MANAGER") &&
+  GdkAtom selection;
+
+  gdk_event_get_selection ((GdkEvent *)event, &selection);
+  if (selection == gdk_atom_intern_static_string ("CLIPBOARD_MANAGER") &&
       clipboard->storing_selection)
     g_main_loop_quit (clipboard->store_loop);
 


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