[mutter/wip/carlosg/release-virtual-buttons] backends/native: Unset the correct button codes when a virtual device is destroyed
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/release-virtual-buttons] backends/native: Unset the correct button codes when a virtual device is destroyed
- Date: Thu, 7 May 2020 16:23:48 +0000 (UTC)
commit 2003039eb28fffa36c78d74728db8b5af21d6b80
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu May 7 18:20:32 2020 +0200
backends/native: Unset the correct button codes when a virtual device is destroyed
We were iterating through evcodes, but using API that expects Clutter button
numbers. Instead of transforming those to Clutter numbers to have those translated
back, use the inner seat API that already takes evcodes.
Fixes stuck buttons keys after a virtual device is destroyed while those are
pressed.
.../native/meta-virtual-input-device-native.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/backends/native/meta-virtual-input-device-native.c
b/src/backends/native/meta-virtual-input-device-native.c
index 9e99c3a5f..c1a45a195 100644
--- a/src/backends/native/meta-virtual-input-device-native.c
+++ b/src/backends/native/meta-virtual-input-device-native.c
@@ -129,20 +129,25 @@ release_pressed_buttons (ClutterVirtualInputDevice *virtual_device)
switch (get_button_type (code))
{
case EVDEV_BUTTON_TYPE_KEY:
- clutter_virtual_input_device_notify_key (virtual_device,
- time_us,
- code,
- CLUTTER_KEY_STATE_RELEASED);
+ meta_seat_native_notify_key (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ code,
+ CLUTTER_KEY_STATE_RELEASED,
+ TRUE);
break;
case EVDEV_BUTTON_TYPE_BUTTON:
- clutter_virtual_input_device_notify_button (virtual_device,
- time_us,
- code,
- CLUTTER_BUTTON_STATE_RELEASED);
+ meta_seat_native_notify_button (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ code,
+ CLUTTER_BUTTON_STATE_RELEASED);
break;
case EVDEV_BUTTON_TYPE_NONE:
g_assert_not_reached ();
}
+
+ update_button_count (virtual_evdev, code, 0);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]