[mutter] clutter/input-device: Replace device check with assertion
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/input-device: Replace device check with assertion
- Date: Wed, 15 May 2019 20:47:05 +0000 (UTC)
commit 786305f7d687c4523504f98b2e60c8d90c1e7920
Author: Jonas Dreßler <verdre v0yd nl>
Date: Mon Feb 4 22:22:48 2019 +0100
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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]