diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2020-12-16 00:02:18 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2020-12-16 17:09:58 +0100 |
commit | 67f0704340b92462cd6cbdee34f96d31c8d9252e (patch) | |
tree | 8e6ec4fa3ea5b8a65c7f3f9236b67cedb42a4304 | |
parent | 96070e820c7b870c600312ffb91b30714abc5ad9 (diff) | |
download | mutter-67f0704340b92462cd6cbdee34f96d31c8d9252e.tar.gz |
backends/native: Make device grouping libinput independent
Keep device groups as opaque pointers, and just compare those
afterwards.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1639>
-rw-r--r-- | src/backends/native/meta-input-device-native.c | 11 | ||||
-rw-r--r-- | src/backends/native/meta-input-device-native.h | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/backends/native/meta-input-device-native.c b/src/backends/native/meta-input-device-native.c index 76795bd57..df7545ede 100644 --- a/src/backends/native/meta-input-device-native.c +++ b/src/backends/native/meta-input-device-native.c @@ -172,13 +172,12 @@ static gboolean meta_input_device_native_is_grouped (ClutterInputDevice *device, ClutterInputDevice *other_device) { - struct libinput_device *libinput_device, *other_libinput_device; + MetaInputDeviceNative *device_native, *other_device_native; - libinput_device = meta_input_device_native_get_libinput_device (device); - other_libinput_device = meta_input_device_native_get_libinput_device (other_device); + device_native = META_INPUT_DEVICE_NATIVE (device); + other_device_native = META_INPUT_DEVICE_NATIVE (other_device); - return libinput_device_get_device_group (libinput_device) == - libinput_device_get_device_group (other_libinput_device); + return device_native->group == other_device_native->group; } static int @@ -1395,6 +1394,8 @@ meta_input_device_native_new_in_impl (MetaSeatImpl *seat_impl, if (libinput_device_get_size (libinput_device, &width, &height) == 0) device->device_aspect_ratio = width / height; + device->group = (intptr_t) libinput_device_get_device_group (libinput_device); + return CLUTTER_INPUT_DEVICE (device); } diff --git a/src/backends/native/meta-input-device-native.h b/src/backends/native/meta-input-device-native.h index 44c31f6ad..841abf1e5 100644 --- a/src/backends/native/meta-input-device-native.h +++ b/src/backends/native/meta-input-device-native.h @@ -77,6 +77,7 @@ struct _MetaInputDeviceNative ClutterInputDeviceTool *last_tool; GArray *pad_features; GArray *modes; + intptr_t group; cairo_matrix_t device_matrix; double device_aspect_ratio; /* w:h */ |