backends/native: Dispose the libinput device in the input thread

Currently, the MetaInputDeviceNative owns the libinput_device, with the
small catch that it is eventually finished in the main thread (as the
CLUTTER_DEVICE_REMOVED event keeps the last reference to it).

Make it sure that the libinput_device is destroyed in the input thread,
before giving away the last extra input device references.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1639>
This commit is contained in:
Carlos Garnacho
2020-12-16 00:09:37 +01:00
parent 67f0704340
commit b2b3d000d2
3 changed files with 10 additions and 1 deletions

View File

@ -1592,3 +1592,9 @@ meta_input_device_native_get_coords_in_impl (MetaInputDeviceNative *device_nativ
if (y)
*y = device_native->pointer_y;
}
void
meta_input_device_native_detach_libinput_in_impl (MetaInputDeviceNative *device_native)
{
g_clear_pointer (&device_native->libinput_device, libinput_device_unref);
}