[gnome-shell/wip/carlosg/osk-cldr: 18/45] keyboard: Restore intended OSK visibility behavior



commit 48bd05f06d178b55014ea5854ff6155b9794f604
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jan 18 18:56:10 2018 +0100

    keyboard: Restore intended OSK visibility behavior
    
    Getting the necessary "setting enabled, or input from touchscreen"
    conditions to have the OSK shown are not enough on the lack of a
    current focus. As we are setting up the caret tracker here, wait for
    the focus in event before showing the keyboard.
    
    This fixes 2 issues, with the setting disabled it became really hard
    to get the OSK hidden on eg. touchscreen->pointer device switches,
    as visibility only depended on the a11y setting here. And secondly,
    enabling the setting would always end up with the OSK being shown
    regardless of focus, while it should stay hidden if there's no text
    edition.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788188

 js/ui/keyboard.js | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 1a251b582..77c44f8c7 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -308,7 +308,7 @@ var Keyboard = new Lang.Class({
     },
 
     _syncEnabled: function () {
-        let wasEnabled = this._enableKeyboard;
+        let wasEnabled = this._enabled;
         this._enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
         this._enabled = this._enableKeyboard || this._lastDeviceIsTouchscreen();
         if (!this._enabled && !this._keyboard)
@@ -319,9 +319,7 @@ var Keyboard = new Lang.Class({
         if (this._enabled && !this._keyboard)
             this._setupKeyboard();
 
-        if (this._enableKeyboard && !wasEnabled)
-            Main.layoutManager.showKeyboard();
-        else if (!this._enableKeyboard && wasEnabled)
+        if (!this._enabled && wasEnabled)
             Main.layoutManager.hideKeyboard(true);
     },
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]