Blame SOURCES/0001-keyboard-Only-enable-keyboard-if-ClutterDeviceManage.patch

bf605f
From 2acede02f30833c3fb891db8483f933f7b41508c Mon Sep 17 00:00:00 2001
bf605f
From: rpm-build <rpm-build>
bf605f
Date: Wed, 21 Oct 2020 21:32:03 +0200
bf605f
Subject: [PATCH] keyboard: Only enable keyboard if
bf605f
 ClutterDeviceManager::touch-mode is enabled
bf605f
bf605f
---
bf605f
 js/ui/keyboard.js | 7 ++++++-
bf605f
 1 file changed, 6 insertions(+), 1 deletion(-)
bf605f
bf605f
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
bf605f
index 94b5325..b1ee270 100644
bf605f
--- a/js/ui/keyboard.js
bf605f
+++ b/js/ui/keyboard.js
bf605f
@@ -1051,6 +1051,9 @@ var Keyboard = class Keyboard {
bf605f
         this._suggestions = null;
bf605f
         this._emojiKeyVisible = true;
bf605f
 
bf605f
+        let manager = Clutter.DeviceManager.get_default();
bf605f
+        manager.connect('notify::touch-mode', this._syncEnabled.bind(this));
bf605f
+
bf605f
         this._focusTracker = new FocusTracker();
bf605f
         this._focusTracker.connect('position-changed', this._onFocusPositionChanged.bind(this));
bf605f
         this._focusTracker.connect('reset', () => {
bf605f
@@ -1120,8 +1123,10 @@ var Keyboard = class Keyboard {
bf605f
 
bf605f
     _syncEnabled() {
bf605f
         let wasEnabled = this._enabled;
bf605f
+        let manager = Clutter.DeviceManager.get_default();
bf605f
+        let autoEnabled = manager.get_touch_mode() && this._lastDeviceIsTouchscreen();
bf605f
         this._enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
bf605f
-        this._enabled = this._enableKeyboard || this._lastDeviceIsTouchscreen();
bf605f
+        this._enabled = this._enableKeyboard || autoEnabled;
bf605f
         if (!this._enabled && !this._keyboardController)
bf605f
             return;
bf605f
 
bf605f
-- 
bf605f
2.26.2
bf605f