[gnome-shell/wip/carlosg/touch-mode] keyboard: Only enable if ClutterSeat::touch-mode is enabled



commit fde30e9c80333578e1c832a85ff225c48d7328c1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Feb 10 20:03:30 2020 +0100

    keyboard: Only enable if ClutterSeat::touch-mode is enabled
    
    This defers the policy on backends about whether it makes sense to
    show the OSK.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/872

 js/ui/keyboard.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 875cb702f7..681fdade05 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1102,6 +1102,9 @@ var KeyboardManager = class KeyBoardManager {
         this._a11yApplicationsSettings = new Gio.Settings({ schema_id: A11Y_APPLICATIONS_SCHEMA });
         this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this));
 
+        this._seat = Clutter.get_default_backend().get_default_seat();
+        this._seat.connect('notify::touch-mode', this._syncEnabled.bind(this));
+
         this._lastDevice = null;
         Meta.get_backend().connect('last-device-changed', (backend, device) => {
             if (device.get_device_name().indexOf('XTEST') < 0) {
@@ -1122,7 +1125,8 @@ var KeyboardManager = class KeyBoardManager {
 
     _syncEnabled() {
         let enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
-        let enabled = enableKeyboard || this._lastDeviceIsTouchscreen();
+        let enabled = enableKeyboard ||
+            (this._seat.get_touch_mode() && this._lastDeviceIsTouchscreen());
         if (!enabled && !this._keyboard)
             return;
 


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