From 08a5f41505005a0b084a45e3ef282c0e4d64f1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 19 Jun 2020 22:37:13 +0200 Subject: [PATCH] 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 1ea5daff7..15e0ab624 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; }