[gnome-shell] keyboard: Don't include keyboard devices when updating lastDevice
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] keyboard: Don't include keyboard devices when updating lastDevice
- Date: Sat, 28 Mar 2020 20:51:47 +0000 (UTC)
commit 8dfed7e762c8c49de3b74fbf155ee79b55f9a051
Author: Jonas Dreßler <verdre v0yd nl>
Date: Sat Mar 28 14:15:09 2020 +0100
keyboard: Don't include keyboard devices when updating lastDevice
We're dealing with attached keyboards now using the touch_mode property
of ClutterSeat: If a device has a keyboard attached, the touch-mode is
FALSE and we won't automatically show the OSK on touches, also the
touch-mode gets set to FALSE when an external keyboard is being plugged
in, so that also hides the OSK automatically.
With that, we can now ignore keyboard devices when updating the last
used device and no longer have to special-case our own virtual devices.
Because there was no special-case for the virtual device we use on
Wayland now, this fixes a bug where the keyboard disappeared after
touching keys like Enter or Backspace.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2287
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142
js/ui/keyboard.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 8b7f0f895b..2cac070db5 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1120,10 +1120,11 @@ var KeyboardManager = class KeyBoardManager {
this._lastDevice = null;
Meta.get_backend().connect('last-device-changed', (backend, device) => {
- if (device.get_device_name().indexOf('XTEST') < 0) {
- this._lastDevice = device;
- this._syncEnabled();
- }
+ if (device.device_type === Clutter.InputDeviceType.KEYBOARD_DEVICE)
+ return;
+
+ this._lastDevice = device;
+ this._syncEnabled();
});
this._syncEnabled();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]