[gnome-shell/wip/carlosg/osk-gesture-feedback: 2/8] windowManager: Move OSK gesture to KeyboardManager




commit 319c82685d76485904bc1bcc0bec21e305e3e6a9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Feb 11 13:41:16 2021 +0100

    windowManager: Move OSK gesture to KeyboardManager
    
    It would be nice to get finer control over the keyboard slide
    gesture and animation. Move the gesture bits so they are together
    at keyboard.js.

 js/ui/keyboard.js      | 15 ++++++++++++++-
 js/ui/windowManager.js | 10 ----------
 2 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index aee2989f46..00d12f26d8 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1,10 +1,11 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 /* exported KeyboardManager */
 
-const { Clutter, Gio, GLib, GObject, Meta, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const ByteArray = imports.byteArray;
 const Signals = imports.signals;
 
+const EdgeDragAction = imports.ui.edgeDragAction;
 const InputSourceManager = imports.ui.status.keyboard;
 const IBusManager = imports.misc.ibusManager;
 const BoxPointer = imports.ui.boxpointer;
@@ -1144,6 +1145,18 @@ var KeyboardManager = class KeyBoardManager {
             this._lastDevice = device;
             this._syncEnabled();
         });
+
+        let mode = Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN;
+        let bottomDragAction = new EdgeDragAction.EdgeDragAction(St.Side.BOTTOM, mode);
+        bottomDragAction.connect('activated', () => {
+            this.open(Main.layoutManager.bottomIndex);
+        });
+        Main.layoutManager.connect('keyboard-visible-changed', (_manager, visible) => {
+            bottomDragAction.cancel();
+            bottomDragAction.set_enabled(!visible);
+        });
+        global.stage.add_action(bottomDragAction);
+
         this._syncEnabled();
     }
 
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index bbe9b5d71f..20c4555658 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -943,16 +943,6 @@ var WindowManager = class {
         global.stage.add_action(appSwitchAction);
 
         let mode = Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN;
-        let bottomDragAction = new EdgeDragAction.EdgeDragAction(St.Side.BOTTOM, mode);
-        bottomDragAction.connect('activated', () => {
-            Main.keyboard.open(Main.layoutManager.bottomIndex);
-        });
-        Main.layoutManager.connect('keyboard-visible-changed', (manager, visible) => {
-            bottomDragAction.cancel();
-            bottomDragAction.set_enabled(!visible);
-        });
-        global.stage.add_action(bottomDragAction);
-
         let topDragAction = new EdgeDragAction.EdgeDragAction(St.Side.TOP, mode);
         topDragAction.connect('activated',  () => {
             let currentWindow = global.display.focus_window;


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