[gnome-shell] windowManager: Support prepending workspace with horizontal layouts



commit 08a5f41505005a0b084a45e3ef282c0e4d64f1d3
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jun 19 22:37:13 2020 +0200

    windowManager: Support prepending workspace with horizontal layouts
    
    Commit ce35d523a2 implemented that behavior for vertical workspace layouts,
    there is no reason to not allow the same for horizontal layouts.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2916

 js/ui/windowManager.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 1ea5daff70..15e0ab624f 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -2115,8 +2115,16 @@ var WindowManager = class {
             newWs = workspaceManager.get_workspace_by_index(workspaceManager.n_workspaces - 1);
         } else if (isNaN(target)) {
             // Prepend a new workspace dynamically
-            if (workspaceManager.get_active_workspace_index() == 0 &&
-                action == 'move' && target == 'up' && this._isWorkspacePrepended == false) {
+            let prependTarget;
+            if (vertical)
+                prependTarget = 'up';
+            else if (rtl)
+                prependTarget = 'right';
+            else
+                prependTarget = 'left';
+            if (workspaceManager.get_active_workspace_index() === 0 &&
+                action === 'move' && target === prependTarget &&
+                this._isWorkspacePrepended === false) {
                 this.insertWorkspace(0);
                 this._isWorkspacePrepended = true;
             }


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