f31430
From 96ccb155bbe6ce570832a9f3d27a0a08698127ea Mon Sep 17 00:00:00 2001
f31430
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
f31430
Date: Sat, 28 Mar 2020 14:15:09 +0100
f31430
Subject: [PATCH 1/3] keyboard: Don't include keyboard devices when updating
f31430
 lastDevice
f31430
f31430
We're dealing with attached keyboards now using the touch_mode property
f31430
of ClutterSeat: If a device has a keyboard attached, the touch-mode is
f31430
FALSE and we won't automatically show the OSK on touches, also the
f31430
touch-mode gets set to FALSE when an external keyboard is being plugged
f31430
in, so that also hides the OSK automatically.
f31430
f31430
With that, we can now ignore keyboard devices when updating the last
f31430
used device and no longer have to special-case our own virtual devices.
f31430
f31430
Because there was no special-case for the virtual device we use on
f31430
Wayland now, this fixes a bug where the keyboard disappeared after
f31430
touching keys like Enter or Backspace.
f31430
f31430
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2287
f31430
f31430
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142
f31430
---
f31430
 js/ui/keyboard.js | 3 +++
f31430
 1 file changed, 3 insertions(+)
f31430
f31430
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
f31430
index c4ac72d..94b5325 100644
f31430
--- a/js/ui/keyboard.js
f31430
+++ b/js/ui/keyboard.js
f31430
@@ -1075,6 +1075,9 @@ var Keyboard = class Keyboard {
f31430
                 let device = manager.get_device(deviceId);
f31430
 
f31430
                 if (device.get_device_name().indexOf('XTEST') < 0) {
f31430
+                    if (device.device_type == Clutter.InputDeviceType.KEYBOARD_DEVICE)
f31430
+                        return;
f31430
+
f31430
                     this._lastDeviceId = deviceId;
f31430
                     this._syncEnabled();
f31430
                 }
f31430
-- 
f31430
2.26.2
f31430
f31430
f31430
From 3106746ae424287d8644643a2ef46d565e4cd7ed Mon Sep 17 00:00:00 2001
f31430
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
f31430
Date: Sat, 28 Mar 2020 14:34:24 +0100
f31430
Subject: [PATCH 2/3] layout: Use translation_y of 0 to hide keyboard
f31430
f31430
Since we show the keyboard using a translation_y of -keyboardHeight, the
f31430
keyboard will be moved down far enough to be out of sight by setting
f31430
translation_y to 0.
f31430
f31430
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142
f31430
---
f31430
 js/ui/layout.js | 6 +++---
f31430
 1 file changed, 3 insertions(+), 3 deletions(-)
f31430
f31430
diff --git a/js/ui/layout.js b/js/ui/layout.js
f31430
index beb4c0a..4382f6e 100644
f31430
--- a/js/ui/layout.js
f31430
+++ b/js/ui/layout.js
f31430
@@ -719,7 +719,7 @@ var LayoutManager = GObject.registerClass({
f31430
     showKeyboard() {
f31430
         this.keyboardBox.show();
f31430
         Tweener.addTween(this.keyboardBox,
f31430
-                         { anchor_y: this.keyboardBox.height,
f31430
+                         { translation_y: -this.keyboardBox.height,
f31430
                            opacity: 255,
f31430
                            time: KEYBOARD_ANIMATION_TIME,
f31430
                            transition: 'easeOutQuad',
f31430
@@ -735,7 +735,7 @@ var LayoutManager = GObject.registerClass({
f31430
         this._updateRegions();
f31430
 
f31430
         this._keyboardHeightNotifyId = this.keyboardBox.connect('notify::height', () => {
f31430
-            this.keyboardBox.anchor_y = this.keyboardBox.height;
f31430
+            this.keyboardBox.translation_y = -this.keyboardBox.height;
f31430
         });
f31430
     }
f31430
 
f31430
@@ -745,7 +745,7 @@ var LayoutManager = GObject.registerClass({
f31430
             this._keyboardHeightNotifyId = 0;
f31430
         }
f31430
         Tweener.addTween(this.keyboardBox,
f31430
-                         { anchor_y: 0,
f31430
+                         { translation_y: 0,
f31430
                            opacity: 0,
f31430
                            time: immediate ? 0 : KEYBOARD_ANIMATION_TIME,
f31430
                            transition: 'easeInQuad',
f31430
-- 
f31430
2.26.2
f31430
f31430
f31430
From 642822308a72be6a47f4eb285f32539499f0d3e4 Mon Sep 17 00:00:00 2001
f31430
From: rpm-build <rpm-build>
f31430
Date: Wed, 21 Oct 2020 20:29:34 +0200
f31430
Subject: [PATCH 3/3] layout: queue redraw after hiding keyboard
f31430
f31430
---
f31430
 js/ui/layout.js | 1 +
f31430
 1 file changed, 1 insertion(+)
f31430
f31430
diff --git a/js/ui/layout.js b/js/ui/layout.js
f31430
index 4382f6e..1824313 100644
f31430
--- a/js/ui/layout.js
f31430
+++ b/js/ui/layout.js
f31430
@@ -759,6 +759,7 @@ var LayoutManager = GObject.registerClass({
f31430
     _hideKeyboardComplete() {
f31430
         this.keyboardBox.hide();
f31430
         this._updateRegions();
f31430
+        global.stage.queue_redraw();
f31430
     }
f31430
 
f31430
     // setDummyCursorGeometry:
f31430
-- 
f31430
2.26.2
f31430