[gtk+] gtk: Avoid some event copies



commit ee178947d7070a6979ccec7701aab065e18123cd
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 31 13:55:33 2017 +0100

    gtk: Avoid some event copies
    
    Those places can do with an extra reference.

 gtk/gtkdnd.c     |    2 +-
 gtk/gtkgesture.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index f789f05..d9ec023 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -1224,7 +1224,7 @@ gtk_drag_begin_internal (GtkWidget          *widget,
  *
  * 3. During a timeout handler, if you want to start a drag after the mouse
  * button is held down for some time.  Try to save the last event that you got
- * from the mouse, using gdk_event_copy(), and pass it to this function
+ * from the mouse, using g_object_ref(), and pass it to this function
  * (remember to free the event with g_object_unref() when you are done).
  * If you can really not pass a real event, pass %NULL instead.
  *
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index fddbe23..53cc0a0 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -531,7 +531,7 @@ _gtk_gesture_update_point (GtkGesture     *gesture,
   if (data->event)
     g_object_unref (data->event);
 
-  data->event = gdk_event_copy (event);
+  data->event = g_object_ref (event);
   _update_touchpad_deltas (data);
   _update_widget_coordinates (gesture, data);
 


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