windowManager: Fix switch animation between non-adjacent workspaces
Commit e5c95b910d refactored the workspace animation to also handle animations that involve all surrounding workspaces, but due to an ill-advised review comment (guess whose) it broke the animation for non-neighboring workspaces. Update the code to handle correctly whether in a given direction: - we have the target workspace of a given index - we have a neighboring workspace - we don't need to animate anything https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/182
This commit is contained in:
parent
2991f9f102
commit
91da3789bc
@ -1856,8 +1856,14 @@ var WindowManager = new Lang.Class({
|
|||||||
let curWs = workspaceManager.get_workspace_by_index (from);
|
let curWs = workspaceManager.get_workspace_by_index (from);
|
||||||
|
|
||||||
for (let dir of Object.values(Meta.MotionDirection)) {
|
for (let dir of Object.values(Meta.MotionDirection)) {
|
||||||
let ws = curWs.get_neighbor(dir);
|
let ws = null;
|
||||||
if (ws == curWs || (to >= 0 && ws.index() != to)) {
|
|
||||||
|
if (to < 0)
|
||||||
|
ws = curWs.get_neighbor(dir);
|
||||||
|
else if (dir == direction)
|
||||||
|
ws = workspaceManager.get_workspace_by_index(to);
|
||||||
|
|
||||||
|
if (ws == null || ws == curWs) {
|
||||||
switchData.surroundings[dir] = null;
|
switchData.surroundings[dir] = null;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user