[gtk+] gtk: Make gtk_get_current_event() return a reference
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtk: Make gtk_get_current_event() return a reference
- Date: Thu, 14 Dec 2017 00:09:22 +0000 (UTC)
commit 332b640cd305862634703a58e30e8495d7809362
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Oct 31 14:03:35 2017 +0100
gtk: Make gtk_get_current_event() return a reference
All callers in gtk seem to be ok with it, and it makes sense if
we are dealing with events as "static after delivered".
gtk/gtkmain.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 8b0f677..2e1a022 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -2324,13 +2324,13 @@ gtk_device_grab_remove (GtkWidget *widget,
/**
* gtk_get_current_event:
*
- * Obtains a copy of the event currently being processed by GTK+.
+ * Obtains a reference of the event currently being processed by GTK+.
*
* For example, if you are handling a #GtkButton::clicked signal,
* the current event will be the #GdkEventButton that triggered
* the ::clicked signal.
*
- * Returns: (transfer full) (nullable): a copy of the current event, or
+ * Returns: (transfer full) (nullable): a reference of the current event, or
* %NULL if there is no current event. The returned event must be
* freed with g_object_unref().
*/
@@ -2338,7 +2338,7 @@ GdkEvent*
gtk_get_current_event (void)
{
if (current_events)
- return gdk_event_copy (current_events->data);
+ return g_object_ref (current_events->data);
else
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]