From 786305f7d687c4523504f98b2e60c8d90c1e7920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Mon, 4 Feb 2019 22:22:48 +0100 Subject: [PATCH] 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 --- clutter/clutter/clutter-input-device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c index 1375e5a4d..be01062cc 100644 --- a/clutter/clutter/clutter-input-device.c +++ b/clutter/clutter/clutter-input-device.c @@ -1036,9 +1036,10 @@ _clutter_input_device_update (ClutterInputDevice *device, ClutterActor *new_cursor_actor; ClutterActor *old_cursor_actor; ClutterPoint point = { -1, -1 }; + ClutterInputDeviceType device_type = device->device_type; - if (device->device_type == CLUTTER_KEYBOARD_DEVICE) - return NULL; + g_assert (device_type != CLUTTER_KEYBOARD_DEVICE && + device_type != CLUTTER_PAD_DEVICE); stage = device->stage; if (G_UNLIKELY (stage == NULL))