gtk: Avoid some event copies
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 31 Oct 2017 12:55:33 +0000 (13:55 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 14 Dec 2017 00:05:48 +0000 (01:05 +0100)
Those places can do with an extra reference.

gtk/gtkdnd.c
gtk/gtkgesture.c

index f789f0593443f75196c2b3f2ad005ced12d28bbc..d9ec023d056c199a535f97a4f14ec020f52fa083 100644 (file)
@@ -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.
  *
index fddbe23406cac71924b1a1170f0d190e8fb68cd0..53cc0a0dd9682320c9ea5eace872b62f23dbb7eb 100644 (file)
@@ -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);