[gtk+/wip/carlosg/event-as-object: 10/23] gdk: Remove gdk_event_is_allocated()



commit ea2ed402e9eb0725a785392c3c39710cbd3a2a2a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Oct 25 14:21:38 2017 +0200

    gdk: Remove gdk_event_is_allocated()
    
    All events are allocated now.

 gdk/gdkevents.c |   21 +--------------------
 1 files changed, 1 insertions(+), 20 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index cbfa32c..5ad6ee1 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -505,8 +505,6 @@ gdk_event_put (const GdkEvent *event)
   gdk_display_put_event (display, event);
 }
 
-static GHashTable *event_hash = NULL;
-
 /**
  * gdk_event_new:
  * @type: a #GdkEventType 
@@ -522,14 +520,9 @@ GdkEvent*
 gdk_event_new (GdkEventType type)
 {
   GdkEvent *new_event;
-  
-  if (!event_hash)
-    event_hash = g_hash_table_new (g_direct_hash, NULL);
 
   new_event = g_object_new (GDK_TYPE_EVENT, NULL);
 
-  g_hash_table_insert (event_hash, new_event, GUINT_TO_POINTER (1));
-
   new_event->any.type = type;
 
   /*
@@ -603,15 +596,6 @@ gdk_event_new (GdkEventType type)
   return new_event;
 }
 
-static gboolean
-gdk_event_is_allocated (const GdkEvent *event)
-{
-  if (event_hash)
-    return g_hash_table_lookup (event_hash, event) != NULL;
-
-  return FALSE;
-}
-
 void
 gdk_event_set_pointer_emulated (GdkEvent *event,
                                 gboolean  emulated)
@@ -739,8 +723,7 @@ gdk_event_copy (const GdkEvent *event)
       break;
     }
 
-  if (gdk_event_is_allocated (event))
-    _gdk_display_event_data_copy (event_get_display (event), event, new_event);
+  _gdk_display_event_data_copy (event_get_display (event), event, new_event);
 
   return new_event;
 }
@@ -838,8 +821,6 @@ gdk_event_finalize (GObject *object)
   g_clear_object (&event->any.device);
   g_clear_object (&event->any.source_device);
 
-  g_hash_table_remove (event_hash, event);
-
   G_OBJECT_CLASS (gdk_event_parent_class)->finalize (object);
 }
 


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