[gtk/readonly-events-1: 37/74] textview: Stop using gdk_event_copy



commit 4cb357a542c5ebd13a9bfe3e910b84555d18cf80
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 15 14:07:09 2020 -0500

    textview: Stop using gdk_event_copy

 gtk/gtktextview.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 5f677847a1..68b5c34141 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -8646,7 +8646,7 @@ gtk_text_view_do_popup (GtkTextView    *text_view,
     return;
 
   if (event)
-    trigger_event = gdk_event_copy (event);
+    trigger_event = (GdkEvent *)event;
   else
     trigger_event = gtk_get_current_event ();
 
@@ -8724,7 +8724,8 @@ gtk_text_view_do_popup (GtkTextView    *text_view,
 
   gtk_popover_popup (GTK_POPOVER (priv->popup_menu));
 
-  g_clear_object (&trigger_event);
+  if (trigger_event && trigger_event != event)
+    g_object_unref (trigger_event);
 }
 
 static gboolean


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