From d0734bc4741d77e7c239cf860b73b49e9564aa91 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 10 Feb 2010 17:12:27 +0000 Subject: [PATCH] input-device: Do not pick() on NULL stages If the stage associated to the InputDevice is not set we should short-circuit out and return NULL. This will result in a pick() done on the event's stage - if applicable. http://bugzilla.moblin.org/show_bug.cgi?id=9602 --- clutter/clutter-input-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c index c3109df04..10e27602c 100644 --- a/clutter/clutter-input-device.c +++ b/clutter/clutter-input-device.c @@ -452,9 +452,11 @@ _clutter_input_device_update (ClutterInputDevice *device) g_return_val_if_fail (device->device_type == CLUTTER_POINTER_DEVICE, NULL); - clutter_input_device_get_device_coords (device, &x, &y); - stage = device->stage; + if (stage == NULL) + return NULL; + + clutter_input_device_get_device_coords (device, &x, &y); old_cursor_actor = device->cursor_actor; new_cursor_actor = _clutter_do_pick (stage, x, y, CLUTTER_PICK_REACTIVE);