workspacesView: Make active workspace above siblings

If there's a window flowing over the left edge in a workspace, the
animation of showing or hiding overview in the left adjacent workspace
would glitch, as the window would appear or disappear suddenly.

This commits tries to fix it by making sure the active workspace are
above other workspaces when updating workspaces or active workspace
changed in workspacesView.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7364
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3378>
(cherry picked from commit ab87629241)
This commit is contained in:
Keyu Tao 2024-06-20 23:09:27 +08:00 committed by Florian Müllner
parent a9033808ad
commit 9b3ab9aca4

View file

@ -440,6 +440,11 @@ class WorkspacesView extends WorkspacesViewBase {
}
}
_raiseActiveWorkspace() {
const activeWorkspace = this.getActiveWorkspace();
this.set_child_above_sibling(activeWorkspace, null);
}
_updateWorkspaces() {
let workspaceManager = global.workspace_manager;
let newNumWorkspaces = workspaceManager.n_workspaces;
@ -472,10 +477,12 @@ class WorkspacesView extends WorkspacesViewBase {
this._updateWorkspacesState();
this._updateVisibility();
this._raiseActiveWorkspace();
}
_activeWorkspaceChanged(_wm, _from, _to, _direction) {
this._scrollToActive();
this._raiseActiveWorkspace();
}
_onDestroy() {