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
This commit is contained in:
Florian Müllner 2020-06-19 22:37:13 +02:00 committed by verdre
parent ec36762309
commit 08a5f41505

View File

@ -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;
}