clutter/input-device: Replace device check with assertion

We only call _clutter_input_device_update with devices that are not
Keyboard devices. Also passing a Keyboard device to a function whose
primary purpose is picking should be considered a bug in the caller.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/547
This commit is contained in:
Jonas Dreßler 2019-02-04 22:22:48 +01:00 committed by Carlos Garnacho
parent 30a2483e6e
commit 786305f7d6

View File

@ -1036,9 +1036,10 @@ _clutter_input_device_update (ClutterInputDevice *device,
ClutterActor *new_cursor_actor; ClutterActor *new_cursor_actor;
ClutterActor *old_cursor_actor; ClutterActor *old_cursor_actor;
ClutterPoint point = { -1, -1 }; ClutterPoint point = { -1, -1 };
ClutterInputDeviceType device_type = device->device_type;
if (device->device_type == CLUTTER_KEYBOARD_DEVICE) g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
return NULL; device_type != CLUTTER_PAD_DEVICE);
stage = device->stage; stage = device->stage;
if (G_UNLIKELY (stage == NULL)) if (G_UNLIKELY (stage == NULL))