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().
This commit is contained in:
Damien Lespiau 2010-11-11 19:11:27 -05:00
parent c20beabf93
commit ac431ac21d

View File

@ -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);