[clutter] stage: Remove tracking input devices, it's not used
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] stage: Remove tracking input devices, it's not used
- Date: Mon, 3 Sep 2012 20:54:13 +0000 (UTC)
commit d5332d1e4c4852148fc0bf71bd3886157330dae6
Author: Tomeu Vizoso <tomeu vizoso collabora com>
Date: Fri Aug 31 18:36:57 2012 +0200
stage: Remove tracking input devices, it's not used
https://bugzilla.gnome.org/show_bug.cgi?id=683126
clutter/clutter-main.c | 4 +-
clutter/clutter-stage-private.h | 7 ----
clutter/clutter-stage.c | 38 -------------------------
clutter/gdk/clutter-event-gdk.c | 4 +-
clutter/osx/clutter-event-osx.c | 4 +-
clutter/win32/clutter-event-win32.c | 4 +-
clutter/x11/clutter-device-manager-core-x11.c | 4 +-
clutter/x11/clutter-device-manager-xi2.c | 4 +-
8 files changed, 12 insertions(+), 57 deletions(-)
---
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index f5d3de1..ed995d3 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -2679,7 +2679,7 @@ _clutter_process_event_details (ClutterActor *stage,
if (event->type == CLUTTER_TOUCH_BEGIN)
{
- _clutter_stage_add_device (CLUTTER_STAGE (stage), device);
+ _clutter_input_device_set_stage (device, CLUTTER_STAGE (stage));
_clutter_input_device_add_sequence (device, sequence);
}
@@ -2717,7 +2717,7 @@ _clutter_process_event_details (ClutterActor *stage,
if (event->type == CLUTTER_TOUCH_END)
{
- _clutter_stage_remove_device (CLUTTER_STAGE (stage), device);
+ _clutter_input_device_set_stage (device, NULL);
_clutter_input_device_remove_sequence (device, sequence);
}
diff --git a/clutter/clutter-stage-private.h b/clutter/clutter-stage-private.h
index 739046e..89d1dbd 100644
--- a/clutter/clutter-stage-private.h
+++ b/clutter/clutter-stage-private.h
@@ -85,13 +85,6 @@ ClutterStageQueueRedrawEntry *_clutter_stage_queue_actor_redraw (Clut
ClutterPaintVolume *clip);
void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry);
-void _clutter_stage_add_device (ClutterStage *stage,
- ClutterInputDevice *device);
-void _clutter_stage_remove_device (ClutterStage *stage,
- ClutterInputDevice *device);
-gboolean _clutter_stage_has_device (ClutterStage *stage,
- ClutterInputDevice *device);
-
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);
gint32 _clutter_stage_acquire_pick_id (ClutterStage *stage,
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index d237fa9..f551de6 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -145,8 +145,6 @@ struct _ClutterStagePrivate
CoglFramebuffer *active_framebuffer;
- GHashTable *devices;
-
GTimer *fps_timer;
gint32 timer_n_frames;
@@ -1843,8 +1841,6 @@ clutter_stage_finalize (GObject *object)
g_array_free (priv->paint_volume_stack, TRUE);
- g_hash_table_destroy (priv->devices);
-
_clutter_id_pool_free (priv->pick_id_pool);
if (priv->fps_timer != NULL)
@@ -2309,8 +2305,6 @@ clutter_stage_init (ClutterStage *self)
priv->paint_volume_stack =
g_array_new (FALSE, FALSE, sizeof (ClutterPaintVolume));
- priv->devices = g_hash_table_new (NULL, NULL);
-
priv->pick_id_pool = _clutter_id_pool_new (256);
}
@@ -4161,38 +4155,6 @@ clutter_stage_get_accept_focus (ClutterStage *stage)
return stage->priv->accept_focus;
}
-void
-_clutter_stage_add_device (ClutterStage *stage,
- ClutterInputDevice *device)
-{
- ClutterStagePrivate *priv = stage->priv;
-
- if (g_hash_table_lookup (priv->devices, device) != NULL)
- return;
-
- g_hash_table_insert (priv->devices, device, GINT_TO_POINTER (1));
- _clutter_input_device_set_stage (device, stage);
-}
-
-void
-_clutter_stage_remove_device (ClutterStage *stage,
- ClutterInputDevice *device)
-{
- ClutterStagePrivate *priv = stage->priv;
-
- _clutter_input_device_set_stage (device, NULL);
- g_hash_table_remove (priv->devices, device);
-}
-
-gboolean
-_clutter_stage_has_device (ClutterStage *stage,
- ClutterInputDevice *device)
-{
- ClutterStagePrivate *priv = stage->priv;
-
- return g_hash_table_lookup (priv->devices, device) != NULL;
-}
-
/**
* clutter_stage_set_motion_events_enabled:
* @stage: a #ClutterStage
diff --git a/clutter/gdk/clutter-event-gdk.c b/clutter/gdk/clutter-event-gdk.c
index 92d3610..09dff41 100644
--- a/clutter/gdk/clutter-event-gdk.c
+++ b/clutter/gdk/clutter-event-gdk.c
@@ -219,9 +219,9 @@ clutter_gdk_handle_event (GdkEvent *gdk_event)
clutter_event_set_device (event, device);
clutter_event_set_source_device (event, source_device);
if (gdk_event->type == GDK_ENTER_NOTIFY)
- _clutter_stage_add_device (stage, clutter_event_get_device (event));
+ _clutter_input_device_set_stage (clutter_event_get_device (event), stage);
else
- _clutter_stage_remove_device (stage, clutter_event_get_device (event));
+ _clutter_input_device_set_stage (clutter_event_get_device (event), NULL);
CLUTTER_NOTE (EVENT, "Crossing %s [%.2f, %.2f]",
event->type == CLUTTER_ENTER ? "enter" : "leave",
event->crossing.x,
diff --git a/clutter/osx/clutter-event-osx.c b/clutter/osx/clutter-event-osx.c
index 386ef7e..1f9ee77 100644
--- a/clutter/osx/clutter-event-osx.c
+++ b/clutter/osx/clutter-event-osx.c
@@ -371,7 +371,7 @@ clutter_event_osx_translate (NSEvent *nsevent,
event->crossing.source = CLUTTER_ACTOR (stage);
clutter_event_set_device (event, manager_osx->core_pointer);
- _clutter_stage_add_device (stage, manager_osx->core_pointer);
+ _clutter_input_device_set_stage (manager_osx->core_pointer, stage);
CLUTTER_NOTE (EVENT, "enter at %f,%f",
event->crossing.x, event->crossing.y);
@@ -385,7 +385,7 @@ clutter_event_osx_translate (NSEvent *nsevent,
event->crossing.source = CLUTTER_ACTOR (stage);
clutter_event_set_device (event, manager_osx->core_pointer);
- _clutter_stage_remove_device (stage, manager_osx->core_pointer);
+ _clutter_input_device_set_stage (manager_osx->core_pointer, NULL);
CLUTTER_NOTE (EVENT, "exit at %f,%f",
event->crossing.x, event->crossing.y);
diff --git a/clutter/win32/clutter-event-win32.c b/clutter/win32/clutter-event-win32.c
index c31697b..5040111 100644
--- a/clutter/win32/clutter-event-win32.c
+++ b/clutter/win32/clutter-event-win32.c
@@ -571,7 +571,7 @@ clutter_win32_handle_event (const MSG *msg)
clutter_event_set_device (event, core_pointer);
/* we entered the stage */
- _clutter_stage_add_device (stage, core_pointer);
+ _clutter_input_device_set_stage (core_pointer, stage);
take_and_queue_event (crossing);
@@ -596,7 +596,7 @@ clutter_win32_handle_event (const MSG *msg)
clutter_event_set_device (event, core_pointer);
/* we left the stage */
- _clutter_stage_remove_device (stage, core_pointer);
+ _clutter_input_device_set_stage (core_pointer, NULL);
/* When we get a leave message the mouse tracking is
automatically cancelled so we'll need to start it again when
diff --git a/clutter/x11/clutter-device-manager-core-x11.c b/clutter/x11/clutter-device-manager-core-x11.c
index 2b7da7c..3b18aa3 100644
--- a/clutter/x11/clutter-device-manager-core-x11.c
+++ b/clutter/x11/clutter-device-manager-core-x11.c
@@ -488,7 +488,7 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
event->crossing.related = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);
- _clutter_stage_add_device (stage, manager_x11->core_pointer);
+ _clutter_input_device_set_stage (manager_x11->core_pointer, stage);
res = CLUTTER_TRANSLATE_QUEUE;
break;
@@ -514,7 +514,7 @@ clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
event->crossing.related = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);
- _clutter_stage_remove_device (stage, manager_x11->core_pointer);
+ _clutter_input_device_set_stage (manager_x11->core_pointer, NULL);
res = CLUTTER_TRANSLATE_QUEUE;
break;
diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c
index 762728b..a714f8d 100644
--- a/clutter/x11/clutter-device-manager-xi2.c
+++ b/clutter/x11/clutter-device-manager-xi2.c
@@ -1185,7 +1185,7 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->crossing.x = xev->event_x;
event->crossing.y = xev->event_y;
- _clutter_stage_add_device (stage, device);
+ _clutter_input_device_set_stage (device, stage);
}
else
{
@@ -1209,7 +1209,7 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->crossing.x = xev->event_x;
event->crossing.y = xev->event_y;
- _clutter_stage_remove_device (stage, device);
+ _clutter_input_device_set_stage (device, NULL);
}
_clutter_input_device_reset_scroll_info (source_device);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]