[gtk/readonly-events-1: 32/32] Stop using g_object_ref/unref on events



commit 64c42655a1e7ab61faad827a1403e4b23b246bbd
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 15 15:07:24 2020 -0500

    Stop using g_object_ref/unref on events
    
    Use gdk_event_ref/unref instead of g_object_ref/unref.
    Events will stop being object soon.

 demos/gtk-demo/popover.c        | 2 +-
 gdk/gdkdrop.c                   | 2 +-
 gdk/gdksurface.c                | 2 +-
 gdk/wayland/gdkdevice-wayland.c | 4 ++--
 gdk/wayland/gdkeventsource.c    | 2 +-
 gdk/win32/gdkevents-win32.c     | 4 ++--
 gdk/x11/gdkdevicemanager-xi2.c  | 2 +-
 gdk/x11/gdkeventsource.c        | 2 +-
 gtk/gtkbutton.c                 | 4 ++--
 gtk/gtkcombobox.c               | 2 +-
 gtk/gtkmain.c                   | 2 +-
 gtk/gtkscrolledwindow.c         | 2 +-
 gtk/gtktreeview.c               | 6 +++---
 gtk/gtkwidget.c                 | 2 +-
 gtk/gtkwindow.c                 | 2 +-
 15 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/demos/gtk-demo/popover.c b/demos/gtk-demo/popover.c
index a1726f8aab..03652f6d39 100644
--- a/demos/gtk-demo/popover.c
+++ b/demos/gtk-demo/popover.c
@@ -119,7 +119,7 @@ day_selected_cb (GtkCalendar *calendar,
 
   gtk_widget_show (popover);
 
-  g_object_unref (event);
+  gdk_event_unref (event);
 }
 
 GtkWidget *
diff --git a/gdk/gdkdrop.c b/gdk/gdkdrop.c
index a9a7c2eb79..c43ec01343 100644
--- a/gdk/gdkdrop.c
+++ b/gdk/gdkdrop.c
@@ -908,7 +908,7 @@ gdk_drop_do_emit_event (GdkEvent *event,
   if (dont_queue)
     {
       _gdk_event_emit (event);
-      g_object_unref (event);
+      gdk_event_unref (event);
     }
   else
     {
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 18ba550c7a..01b2bd8fed 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -2758,7 +2758,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
     {
       _gdk_event_queue_remove_link (display, event_link);
       g_list_free_1 (event_link);
-      g_object_unref (event);
+      gdk_event_unref (event);
     }
 
   /* This does two things - first it sees if there are motions at the
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 0d20c5cbf3..63a47bae3b 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -3219,7 +3219,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
   if (!event)
     return;
 
-  g_object_ref (event);
+  gdk_event_ref (event);
 
   if (event->any.type == GDK_PROXIMITY_OUT)
     emulate_crossing (event->any.surface, NULL,
@@ -3234,7 +3234,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
                       tablet->master, GDK_ENTER_NOTIFY,
                       GDK_CROSSING_NORMAL, time);
 
-  g_object_unref (event);
+  gdk_event_unref (event);
 }
 
 static void
diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c
index 86c3f86484..04ca9cbe61 100644
--- a/gdk/wayland/gdkeventsource.c
+++ b/gdk/wayland/gdkeventsource.c
@@ -121,7 +121,7 @@ gdk_event_source_dispatch (GSource     *base,
     {
       _gdk_event_emit (event);
 
-      g_object_unref (event);
+      gdk_event_unref (event);
     }
 
   return TRUE;
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index d997ec55fb..af8755be71 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -3588,7 +3588,7 @@ gdk_event_translate (MSG  *msg,
       if (event)
         {
           _gdk_win32_append_event (event);
-         g_object_unref (event);
+         gdk_event_unref (event);
         }
 
       break;
@@ -3670,7 +3670,7 @@ gdk_event_dispatch (GSource     *source,
     {
       _gdk_event_emit (event);
 
-      g_object_unref (event);
+      gdk_event_unref (event);
     }
 
   return TRUE;
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 9e763094ff..ae3714c10a 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1458,7 +1458,7 @@ _gdk_device_manager_xi2_handle_focus (GdkSurface *surface,
 
       event = gdk_event_focus_new (surface, device, source_device, focus_in);
       gdk_display_put_event (gdk_surface_get_display (surface), event);
-      g_object_unref (event);
+      gdk_event_unref (event);
     }
 }
 
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index 9c172b51f4..f15cba480b 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -425,7 +425,7 @@ gdk_event_source_dispatch (GSource     *source,
     {
       _gdk_event_emit (event);
 
-      g_object_unref (event);
+      gdk_event_unref (event);
     }
 
   return TRUE;
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index c69024e84c..b8ee4dd2f6 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -318,13 +318,13 @@ touch_release_in_button (GtkButton *button)
 
   if (gdk_event_get_event_type (event) != GDK_TOUCH_END)
     {
-      g_object_unref (event);
+      gdk_event_unref (event);
       return FALSE;
     }
 
   gdk_event_get_coords (event, &x, &y);
 
-  g_object_unref (event);
+  gdk_event_unref (event);
 
   if (gtk_widget_contains (GTK_WIDGET (button), x, y))
     return TRUE;
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index e500a765f6..ac529c718e 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1800,7 +1800,7 @@ gtk_combo_box_menu_key (GtkEventControllerKey *key,
       gtk_event_controller_key_forward (key, GTK_WIDGET (combo_box));
     }
 
-  g_object_unref (event);
+  gdk_event_unref (event);
 
   return TRUE;
 }
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index fedcdb8464..b2168cb411 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1341,7 +1341,7 @@ synth_crossing (GtkWidget       *widget,
     gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_PRELIGHT);
 
   gtk_widget_event (widget, event);
-  g_object_unref (event);
+  gdk_event_unref (event);
 }
 
 void
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 2a9aef9700..d26d84b7b4 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1223,7 +1223,7 @@ captured_motion (GtkScrolledWindow *sw,
         indicator_set_over (&priv->hindicator, FALSE);
     }
 
-  g_object_unref (event);
+  gdk_event_unref (event);
 }
 
 static gboolean
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 27b0576477..1018fa87e4 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5438,11 +5438,11 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key,
   event = gtk_get_current_event ();
   if (gtk_bindings_activate_event (G_OBJECT (widget), (GdkEventKey *)event))
     {
-      g_object_unref (event);
+      gdk_event_unref (event);
       return TRUE;
     }
 
-  g_object_unref (event);
+  gdk_event_unref (event);
 
   if (tree_view->search_entry_avoid_unhandled_binding)
     {
@@ -5497,7 +5497,7 @@ gtk_tree_view_key_controller_key_released (GtkEventControllerKey *key,
   /* Handle the keybindings. */
   event = gtk_get_current_event ();
   gtk_bindings_activate_event (G_OBJECT (tree_view), (GdkEventKey *)event);
-  g_object_unref (event);
+  gdk_event_unref (event);
 }
 
 static void
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 915edcbef5..b4a996b440 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -7962,7 +7962,7 @@ synth_crossing (GtkWidget       *widget,
   if (widget)
     gtk_widget_event_internal (widget, event);
 
-  g_object_unref (event);
+  gdk_event_unref (event);
 }
 
 /*
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 1f228bae32..e14b07980d 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6391,7 +6391,7 @@ gtk_window_set_focus (GtkWindow *window,
 
   gtk_synthesize_crossing_events (GTK_ROOT (window), old_focus, focus, event, GDK_CROSSING_NORMAL);
 
-  g_object_unref (event);
+  gdk_event_unref (event);
 
   g_set_object (&priv->focus_widget, focus);
 


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