summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkbutton.c4
-rw-r--r--gtk/gtkdnd.c2
-rw-r--r--gtk/gtkentry.c2
-rw-r--r--gtk/gtkgesture.c4
-rw-r--r--gtk/gtkimcontextsimple.c2
-rw-r--r--gtk/gtkmain.c6
-rw-r--r--gtk/gtkmenu.c8
-rw-r--r--gtk/gtkmenubutton.c2
-rw-r--r--gtk/gtkmenuitem.c4
-rw-r--r--gtk/gtktextview.c4
-rw-r--r--gtk/gtktreeview.c4
-rw-r--r--gtk/gtkwidget.c10
-rw-r--r--gtk/gtkwindow.c4
13 files changed, 28 insertions, 28 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index b89ac609d1..f08244a6bc 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -323,13 +323,13 @@ touch_release_in_button (GtkButton *button)
if (gdk_event_get_event_type (event) != GDK_TOUCH_END)
{
- gdk_event_free (event);
+ g_object_unref (event);
return FALSE;
}
gdk_event_get_coords (event, &x, &y);
- gdk_event_free (event);
+ g_object_unref (event);
if (gtk_widget_contains (GTK_WIDGET (button), x, y))
return TRUE;
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index c7b77656b0..f789f05934 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -1225,7 +1225,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
- * (remember to free the event with gdk_event_free() when you are done).
+ * (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.
*
* Returns: (transfer none): the context for this drag
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 2a04b26130..14e2e27d53 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -8622,7 +8622,7 @@ gtk_entry_do_popup (GtkEntry *entry,
}
}
- g_clear_pointer (&trigger_event, gdk_event_free);
+ g_clear_object (&trigger_event);
}
static gboolean
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index 8c7ed9501d..fddbe23406 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -529,7 +529,7 @@ _gtk_gesture_update_point (GtkGesture *gesture,
}
if (data->event)
- gdk_event_free (data->event);
+ g_object_unref (data->event);
data->event = gdk_event_copy (event);
_update_touchpad_deltas (data);
@@ -912,7 +912,7 @@ free_point_data (gpointer data)
PointData *point = data;
if (point->event)
- gdk_event_free (point->event);
+ g_object_unref (point->event);
g_free (point);
}
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index 0c2c41681b..46046009d2 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -1057,7 +1057,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
gdk_event_set_keyval (tmp_event, priv->compose_buffer[len + i]);
gtk_im_context_filter_keypress (context, (GdkEventKey *)tmp_event);
- gdk_event_free (tmp_event);
+ g_object_unref (tmp_event);
}
return gtk_im_context_filter_keypress (context, event);
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 1a21eefa6c..8b0f6774e0 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1416,7 +1416,7 @@ synth_crossing (GtkWidget *widget,
event->crossing.detail = notify_type;
gtk_widget_event (widget, event);
- gdk_event_free (event);
+ g_object_unref (event);
}
static GtkWidget *
@@ -1912,7 +1912,7 @@ gtk_main_do_event (GdkEvent *event)
g_list_free_1 (tmp_list);
if (rewritten_event)
- gdk_event_free (rewritten_event);
+ g_object_unref (rewritten_event);
}
/**
@@ -2332,7 +2332,7 @@ gtk_device_grab_remove (GtkWidget *widget,
*
* Returns: (transfer full) (nullable): a copy of the current event, or
* %NULL if there is no current event. The returned event must be
- * freed with gdk_event_free().
+ * freed with g_object_unref().
*/
GdkEvent*
gtk_get_current_event (void)
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 26ceb72a5f..431a02895b 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1692,7 +1692,7 @@ gtk_menu_popup_internal (GtkMenu *menu,
menu_shell->priv->ignore_enter = TRUE;
source_device = gdk_event_get_source_device (current_event);
- gdk_event_free (current_event);
+ g_object_unref (current_event);
}
else
menu_shell->priv->ignore_enter = TRUE;
@@ -1990,7 +1990,7 @@ gtk_menu_popup_at_rect (GtkMenu *menu,
button,
activate_time);
- g_clear_pointer (&current_event, gdk_event_free);
+ g_clear_object (&current_event);
}
/**
@@ -2083,7 +2083,7 @@ gtk_menu_popup_at_widget (GtkMenu *menu,
button,
activate_time);
- g_clear_pointer (&current_event, gdk_event_free);
+ g_clear_object (&current_event);
}
/**
@@ -2150,7 +2150,7 @@ gtk_menu_popup_at_pointer (GtkMenu *menu,
GDK_GRAVITY_NORTH_WEST,
trigger_event);
- g_clear_pointer (&current_event, gdk_event_free);
+ g_clear_object (&current_event);
}
static void
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index 84f10d8829..b804a5af69 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -423,7 +423,7 @@ gtk_menu_button_toggled (GtkToggleButton *button)
gtk_menu_shell_select_first (GTK_MENU_SHELL (priv->menu), FALSE);
if (event)
- gdk_event_free (event);
+ g_object_unref (event);
}
}
else if (priv->popover)
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 0d7453ee63..4b5ce1244b 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1178,7 +1178,7 @@ gtk_real_menu_item_select (GtkMenuItem *menu_item)
if (current_event)
{
source_device = gdk_event_get_source_device (current_event);
- gdk_event_free (current_event);
+ g_object_unref (current_event);
}
if ((!source_device ||
@@ -1516,7 +1516,7 @@ gtk_menu_item_popup_timeout (gpointer data)
priv->timer = 0;
- g_clear_pointer (&info->trigger_event, gdk_event_free);
+ g_clear_object (&info->trigger_event);
g_slice_free (PopupInfo, info);
return FALSE;
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 12475c416a..207486d100 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -8379,7 +8379,7 @@ gtk_text_view_value_changed (GtkAdjustment *adjustment,
if (gdk_event_get_event_type (current_event) == GDK_SCROLL)
move_mark_to_pointer_and_scroll (text_view, "insert");
- gdk_event_free (current_event);
+ g_object_unref (current_event);
}
}
@@ -8860,7 +8860,7 @@ gtk_text_view_do_popup (GtkTextView *text_view,
}
}
- g_clear_pointer (&trigger_event, gdk_event_free);
+ g_clear_object (&trigger_event);
}
static gboolean
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index ac384fdbcc..1ed2e19cea 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5743,7 +5743,7 @@ gtk_tree_view_key_press (GtkWidget *widget,
/* Because we keep the focus on the treeview, we need to forward the
* key events to the entry, when it is visible. */
gtk_widget_event (search_window, new_event);
- gdk_event_free (new_event);
+ g_object_unref (new_event);
g_signal_handler_disconnect (tree_view->priv->search_entry,
popup_menu_id);
@@ -10652,7 +10652,7 @@ send_focus_change (GtkWidget *widget,
gtk_widget_send_focus_change (widget, fevent);
- gdk_event_free (fevent);
+ g_object_unref (fevent);
}
g_list_free (devices);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 15fa27a1dc..c5dc3a44ad 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3448,7 +3448,7 @@ _gtk_widget_emulate_press (GtkWidget *widget,
/* Perform propagation state starting from the next child in the chain */
gtk_propagate_event_internal (event_widget, press, next_child);
- gdk_event_free (press);
+ g_object_unref (press);
}
static const GdkEvent *
@@ -6511,7 +6511,7 @@ _gtk_widget_captured_event (GtkWidget *widget,
g_object_unref (widget);
out:
- gdk_event_free (event_copy);
+ g_object_unref (event_copy);
return return_val;
}
@@ -6625,7 +6625,7 @@ gtk_widget_event_internal (GtkWidget *widget,
if (return_val == FALSE)
return_val |= _gtk_widget_run_controllers (widget, event_copy, GTK_PHASE_BUBBLE);
- gdk_event_free (event_copy);
+ g_object_unref (event_copy);
return return_val;
}
@@ -10291,7 +10291,7 @@ synth_crossing (GtkWidget *widget,
if (widget)
gtk_widget_event_internal (widget, event);
- gdk_event_free (event);
+ g_object_unref (event);
}
/*
@@ -13321,7 +13321,7 @@ gtk_widget_get_opacity (GtkWidget *widget)
*
* gtk_widget_send_focus_change (widget, fevent);
*
- * gdk_event_free (event);
+ * g_object_unref (event);
* ]|
*
* Returns: the return value from the event signal emission: %TRUE
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 9882a64646..94c1ba4ad8 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1337,7 +1337,7 @@ send_delete_event (gpointer data)
priv->delete_event_handler = 0;
gtk_main_do_event (event);
- gdk_event_free (event);
+ g_object_unref (event);
return G_SOURCE_REMOVE;
}
@@ -7637,7 +7637,7 @@ do_focus_change (GtkWidget *widget,
gtk_widget_send_focus_change (widget, fevent);
- gdk_event_free (fevent);
+ g_object_unref (fevent);
}
g_list_free (devices);