From ac431ac21db043d42fa5b0be604a155503846012 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Thu, 11 Nov 2010 19:11:27 -0500 Subject: [PATCH] input-device: Warn if the device has no associated stage Discarding the event without any warning when the device has no associated stage makes it hard to find the bug for people implementing new event backends. We should really warn for that abnormal condition in _clutter_input_device_update(). --- clutter/clutter-input-device.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c index b2bfe46ad..1a890fa06 100644 --- a/clutter/clutter-input-device.c +++ b/clutter/clutter-input-device.c @@ -513,8 +513,12 @@ _clutter_input_device_update (ClutterInputDevice *device) g_return_val_if_fail (device->device_type == CLUTTER_POINTER_DEVICE, NULL); stage = device->stage; - if (stage == NULL) - return NULL; + if (G_UNLIKELY (stage == NULL)) + { + g_warning ("No stage defined for device '%s'", + clutter_input_device_get_device_name (device)); + return NULL; + } clutter_input_device_get_device_coords (device, &x, &y);