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

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