gdk: Remove gdk_event_is_allocated()
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 25 Oct 2017 12:21:38 +0000 (14:21 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 14 Dec 2017 00:05:48 +0000 (01:05 +0100)
All events are allocated now.

gdk/gdkevents.c

index 80f92ec6a65041cd078ccdba999d954e11776c53..44e660c7ba5bb3ee55bb5e260b02cc8c4be0850c 100644 (file)
@@ -376,8 +376,6 @@ gdk_event_handler_set (GdkEventFunc   func,
   _gdk_event_notify = notify;
 }
 
-static GHashTable *event_hash = NULL;
-
 /**
  * gdk_event_new:
  * @type: a #GdkEventType 
@@ -393,14 +391,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;
 
   /*
@@ -474,15 +467,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)
@@ -596,8 +580,7 @@ gdk_event_copy (const GdkEvent *event)
       break;
     }
 
-  if (gdk_event_is_allocated (event))
-    _gdk_display_event_data_copy (gdk_event_get_display (event), event, new_event);
+  _gdk_display_event_data_copy (gdk_event_get_display (event), event, new_event);
 
   return new_event;
 }
@@ -683,8 +666,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);
 }