From cca2e5bc9c1610881f69238b2c23c34233ea8451 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 18 Feb 2011 19:27:58 +0000 Subject: [PATCH] device-manager: Use per-stage motion event toggle Now that we have internal support for per-stage granularity of motion event delivery, let's use it when updating the state of the input devices. --- clutter/clutter-device-manager.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/clutter/clutter-device-manager.c b/clutter/clutter-device-manager.c index 53e812c83..363b4bcb1 100644 --- a/clutter/clutter-device-manager.c +++ b/clutter/clutter-device-manager.c @@ -46,6 +46,7 @@ #include "clutter-enum-types.h" #include "clutter-marshal.h" #include "clutter-private.h" +#include "clutter-stage-private.h" #define CLUTTER_DEVICE_MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_DEVICE_MANAGER, ClutterDeviceManagerPrivate)) @@ -400,13 +401,6 @@ _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager) { const GSList *d; - /* the user disabled motion events delivery on actors; we - * don't perform any picking since the source of the events - * will always be set to be the stage - */ - if (!clutter_get_motion_events_enabled ()) - return; - for (d = clutter_device_manager_peek_devices (device_manager); d != NULL; d = d->next) @@ -423,6 +417,14 @@ _clutter_device_manager_update_devices (ClutterDeviceManager *device_manager) if (device->stage == NULL) continue; + /* the user disabled motion events delivery on actors for + * the stage the device is on; we don't perform any picking + * since the source of the events will always be set to be + * the stage + */ + if (!_clutter_stage_get_motion_events_enabled (device->stage)) + continue; + _clutter_input_device_update (device, TRUE); } }