[gtk+/wip/carlosg/event-as-object: 23/23] gdk: Make gdk_display_peek_event() Return a reference to the event



commit ef663f257f717fe4ce86ed3fdee926e5ba570dd5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 31 15:40:16 2017 +0100

    gdk: Make gdk_display_peek_event() Return a reference to the event
    
    And gdk_peek_event() indirectly, but that one should probably be removed.

 gdk/gdkdisplay.c |    4 ++--
 gdk/gdkevents.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index ec4c0b5..617df7a 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -522,7 +522,7 @@ gdk_display_get_event (GdkDisplay *display)
  * 
  * Returns: (nullable): a copy of the first #GdkEvent on the event
  * queue, or %NULL if no events are in the queue. The returned
- * #GdkEvent should be freed with gdk_event_free().
+ * #GdkEvent should be freed with g_object_unref().
  *
  * Since: 2.2
  **/
@@ -536,7 +536,7 @@ gdk_display_peek_event (GdkDisplay *display)
   tmp_list = _gdk_event_queue_find_first (display);
   
   if (tmp_list)
-    return gdk_event_copy (tmp_list->data);
+    return g_object_ref (tmp_list->data);
   else
     return NULL;
 }
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 2eb27de..fb2b70d 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -547,7 +547,7 @@ gdk_event_get (void)
  * 
  * Returns: (nullable): a copy of the first #GdkEvent on some event
  * queue, or %NULL if no events are in any queues. The returned
- * #GdkEvent should be freed with gdk_event_free().
+ * #GdkEvent should be freed with g_object_unref().
  **/
 GdkEvent*
 gdk_event_peek (void)


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