Blob Blame History Raw
From 96ccb155bbe6ce570832a9f3d27a0a08698127ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
Date: Sat, 28 Mar 2020 14:15:09 +0100
Subject: [PATCH 1/3] 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 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index c4ac72d..94b5325 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1075,6 +1075,9 @@ var Keyboard = class Keyboard {
                 let device = manager.get_device(deviceId);
 
                 if (device.get_device_name().indexOf('XTEST') < 0) {
+                    if (device.device_type == Clutter.InputDeviceType.KEYBOARD_DEVICE)
+                        return;
+
                     this._lastDeviceId = deviceId;
                     this._syncEnabled();
                 }
-- 
2.26.2


From 3106746ae424287d8644643a2ef46d565e4cd7ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
Date: Sat, 28 Mar 2020 14:34:24 +0100
Subject: [PATCH 2/3] layout: Use translation_y of 0 to hide keyboard

Since we show the keyboard using a translation_y of -keyboardHeight, the
keyboard will be moved down far enough to be out of sight by setting
translation_y to 0.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142
---
 js/ui/layout.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/js/ui/layout.js b/js/ui/layout.js
index beb4c0a..4382f6e 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -719,7 +719,7 @@ var LayoutManager = GObject.registerClass({
     showKeyboard() {
         this.keyboardBox.show();
         Tweener.addTween(this.keyboardBox,
-                         { anchor_y: this.keyboardBox.height,
+                         { translation_y: -this.keyboardBox.height,
                            opacity: 255,
                            time: KEYBOARD_ANIMATION_TIME,
                            transition: 'easeOutQuad',
@@ -735,7 +735,7 @@ var LayoutManager = GObject.registerClass({
         this._updateRegions();
 
         this._keyboardHeightNotifyId = this.keyboardBox.connect('notify::height', () => {
-            this.keyboardBox.anchor_y = this.keyboardBox.height;
+            this.keyboardBox.translation_y = -this.keyboardBox.height;
         });
     }
 
@@ -745,7 +745,7 @@ var LayoutManager = GObject.registerClass({
             this._keyboardHeightNotifyId = 0;
         }
         Tweener.addTween(this.keyboardBox,
-                         { anchor_y: 0,
+                         { translation_y: 0,
                            opacity: 0,
                            time: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
                            transition: 'easeInQuad',
-- 
2.26.2


From 642822308a72be6a47f4eb285f32539499f0d3e4 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Wed, 21 Oct 2020 20:29:34 +0200
Subject: [PATCH 3/3] layout: queue redraw after hiding keyboard

---
 js/ui/layout.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/js/ui/layout.js b/js/ui/layout.js
index 4382f6e..1824313 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -759,6 +759,7 @@ var LayoutManager = GObject.registerClass({
     _hideKeyboardComplete() {
         this.keyboardBox.hide();
         this._updateRegions();
+        global.stage.queue_redraw();
     }
 
     // setDummyCursorGeometry:
-- 
2.26.2