Commit c343031a authored by Matthias Clasen's avatar Matthias Clasen
Browse files

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.
parent 835556c2
......@@ -119,7 +119,7 @@ day_selected_cb (GtkCalendar *calendar,
gtk_widget_show (popover);
g_object_unref (event);
gdk_event_unref (event);
}
GtkWidget *
......
......@@ -376,7 +376,7 @@ gdk_event_source_dispatch (GSource *source,
{
_gdk_event_emit (event);
g_object_unref (event);
gdk_event_unref (event);
}
return TRUE;
......
......@@ -469,7 +469,7 @@ gdk_display_peek_event (GdkDisplay *display)
tmp_list = _gdk_event_queue_find_first (display);
if (tmp_list != NULL)
return g_object_ref (tmp_list->data);
return gdk_event_ref (tmp_list->data);
return NULL;
}
......@@ -489,7 +489,7 @@ gdk_display_put_event (GdkDisplay *display,
g_return_if_fail (GDK_IS_DISPLAY (display));
g_return_if_fail (event != NULL);
_gdk_event_queue_append (display, g_object_ref ((GdkEvent *)event));
_gdk_event_queue_append (display, gdk_event_ref ((GdkEvent *)event));
}
static void
......
......@@ -952,7 +952,7 @@ gdk_drop_do_emit_event (GdkEvent *event,
if (dont_queue)
{
_gdk_event_emit (event);
g_object_unref (event);
gdk_event_unref (event);
}
else
{
......
......@@ -420,7 +420,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
GDK_BUTTON4_MASK | GDK_BUTTON5_MASK)))
gdk_event_push_history (last_motion, pending_motions->data);
g_object_unref (pending_motions->data);
gdk_event_unref (pending_motions->data);
g_queue_delete_link (&display->queued_events, pending_motions);
pending_motions = next;
}
......
......@@ -2744,7 +2744,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
......
......@@ -3224,7 +3224,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,
......@@ -3239,7 +3239,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
......
......@@ -140,7 +140,7 @@ gdk_event_source_dispatch (GSource *base,
{
_gdk_event_emit (event);
g_object_unref (event);
gdk_event_unref (event);
}
return TRUE;
......
......@@ -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;
......
......@@ -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);
}
}
......
......@@ -425,7 +425,7 @@ gdk_event_source_dispatch (GSource *source,
{
_gdk_event_emit (event);
g_object_unref (event);
gdk_event_unref (event);
}
return TRUE;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -530,9 +530,9 @@ _gtk_gesture_update_point (GtkGesture *gesture,
}
if (data->event)
g_object_unref (data->event);
gdk_event_unref (data->event);
data->event = g_object_ref ((gpointer) event);
data->event = gdk_event_ref ((GdkEvent *)event);
_update_touchpad_deltas (data);
_update_widget_coordinates (gesture, data);
......@@ -896,7 +896,7 @@ free_point_data (gpointer data)
PointData *point = data;
if (point->event)
g_object_unref (point->event);
gdk_event_unref (point->event);
g_free (point);
}
......
......@@ -1395,7 +1395,7 @@ synth_crossing (GtkWidget *widget,
}
gtk_widget_event (widget, event);
g_object_unref (event);
gdk_event_unref (event);
}
void
......@@ -1910,7 +1910,7 @@ gtk_main_do_event (GdkEvent *event)
g_list_free_1 (tmp_list);
if (rewritten_event)
g_object_unref (rewritten_event);
gdk_event_unref (rewritten_event);
}
static GtkWindowGroup *
......@@ -2265,7 +2265,7 @@ GdkEvent*
gtk_get_current_event (void)
{
if (current_events)
return g_object_ref (current_events->data);
return gdk_event_ref (current_events->data);
else
return NULL;
}
......
......@@ -1223,7 +1223,7 @@ captured_motion (GtkScrolledWindow *sw,
indicator_set_over (&priv->hindicator, FALSE);
}
g_object_unref (event);
gdk_event_unref (event);
}
static gboolean
......
......@@ -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
......
......@@ -7981,7 +7981,7 @@ synth_crossing (GtkWidget *widget,
if (widget)
gtk_widget_event_internal (widget, event);
g_object_unref (event);
gdk_event_unref (event);
}
/*
......
......@@ -6388,7 +6388,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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment