Citadel changes to gnome-shell

This commit is contained in:
2021-12-03 14:04:05 -05:00
parent a2ffd14a35
commit f675f95c67
39 changed files with 3205 additions and 33 deletions

View File

@ -204,6 +204,8 @@ class WorkspaceTracker {
workspaceManager.connect('workspaces-reordered', () => {
this._workspaces.sort((a, b) => a.index() - b.index());
});
workspaceManager.connect('context-switched',
this._workspaceContextSwitched.bind(this));
global.window_manager.connect('switch-workspace',
this._queueCheckWorkspaces.bind(this));
@ -259,6 +261,8 @@ class WorkspaceTracker {
emptyWorkspaces[index] = false;
}
let current_context_id = workspaceManager.active_context_id();
let windows = global.get_window_actors();
for (i = 0; i < windows.length; i++) {
let actor = windows[i];
@ -267,7 +271,12 @@ class WorkspaceTracker {
if (win.is_on_all_workspaces())
continue;
let workspaceIndex = win.get_workspace().index();
let workspace = win.get_workspace();
if (workspace.get_context_id() != current_context_id)
continue;
let workspaceIndex = workspace.index();
emptyWorkspaces[workspaceIndex] = false;
}
@ -348,6 +357,28 @@ class WorkspaceTracker {
}
}
_workspaceContextSwitched() {
let workspaceManager = global.workspace_manager;
let numWorkspaces = workspaceManager.n_workspaces;
this._workspaces.forEach(workspace => {
workspace.disconnect(workspace._windowAddedId);
workspace.disconnect(workspace._windowRemovedId);
});
this._workspaces = [];
for (let w = 0; w < numWorkspaces; w++) {
let workspace = workspaceManager.get_workspace_by_index(w);
workspace._windowAddedId = workspace.connect('window-added', this._queueCheckWorkspaces.bind(this));
workspace._windowRemovedId = workspace.connect('window-removed', this._windowRemoved.bind(this));
this._workspaces[w] = workspace;
}
this._queueCheckWorkspaces();
return false;
}
_nWorkspacesChanged() {
let workspaceManager = global.workspace_manager;
let oldNumWorkspaces = this._workspaces.length;
@ -1635,6 +1666,14 @@ export class WindowManager {
this._switchInProgress = true;
if (direction == Meta.MotionDirection.CONTEXT_SWITCH) {
Main.realmManager.animateSwitch(from, to, () => {
this._shellwm.completed_switch_workspace();
this._switchInProgress = false;
});
return;
}
this._workspaceAnimation.animateSwitch(from, to, direction, () => {
this._shellwm.completed_switch_workspace();
this._switchInProgress = false;