cleanup: Use Meta.Workspace.active property
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1337
This commit is contained in:
parent
73f8c1c482
commit
e90466347a
@ -1800,8 +1800,7 @@ var WindowManager = class {
|
|||||||
w.window.get_parent().remove_child(w.window);
|
w.window.get_parent().remove_child(w.window);
|
||||||
w.parent.add_child(w.window);
|
w.parent.add_child(w.window);
|
||||||
|
|
||||||
if (w.window.get_meta_window().get_workspace() !=
|
if (!w.window.get_meta_window().get_workspace().active)
|
||||||
global.workspace_manager.get_active_workspace())
|
|
||||||
w.window.hide();
|
w.window.hide();
|
||||||
}
|
}
|
||||||
switchData.container.destroy();
|
switchData.container.destroy();
|
||||||
@ -1985,7 +1984,7 @@ var WindowManager = class {
|
|||||||
duration,
|
duration,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
|
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
if (newWs !== activeWorkspace)
|
if (!newWs.active)
|
||||||
this.actionMoveWorkspace(newWs);
|
this.actionMoveWorkspace(newWs);
|
||||||
this._finishWorkspaceSwitch(switchData);
|
this._finishWorkspaceSwitch(switchData);
|
||||||
},
|
},
|
||||||
@ -2185,10 +2184,7 @@ var WindowManager = class {
|
|||||||
if (!Main.sessionMode.hasWorkspaces)
|
if (!Main.sessionMode.hasWorkspaces)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let workspaceManager = global.workspace_manager;
|
if (!workspace.active)
|
||||||
let activeWorkspace = workspaceManager.get_active_workspace();
|
|
||||||
|
|
||||||
if (activeWorkspace != workspace)
|
|
||||||
workspace.activate(global.get_current_time());
|
workspace.activate(global.get_current_time());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2196,10 +2192,7 @@ var WindowManager = class {
|
|||||||
if (!Main.sessionMode.hasWorkspaces)
|
if (!Main.sessionMode.hasWorkspaces)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let workspaceManager = global.workspace_manager;
|
if (!workspace.active) {
|
||||||
let activeWorkspace = workspaceManager.get_active_workspace();
|
|
||||||
|
|
||||||
if (activeWorkspace != workspace) {
|
|
||||||
// This won't have any effect for "always sticky" windows
|
// This won't have any effect for "always sticky" windows
|
||||||
// (like desktop windows or docks)
|
// (like desktop windows or docks)
|
||||||
|
|
||||||
|
@ -601,9 +601,8 @@ class Workspace extends St.Widget {
|
|||||||
let area = padArea(this._actualGeometry, padding);
|
let area = padArea(this._actualGeometry, padding);
|
||||||
let slots = strategy.computeWindowSlots(layout, area);
|
let slots = strategy.computeWindowSlots(layout, area);
|
||||||
|
|
||||||
let workspaceManager = global.workspace_manager;
|
const isOnCurrentWorkspace =
|
||||||
let currentWorkspace = workspaceManager.get_active_workspace();
|
this.metaWorkspace === null || this.metaWorkspace.active;
|
||||||
let isOnCurrentWorkspace = this.metaWorkspace == null || this.metaWorkspace == currentWorkspace;
|
|
||||||
|
|
||||||
for (let i = 0; i < slots.length; i++) {
|
for (let i = 0; i < slots.length; i++) {
|
||||||
let slot = slots[i];
|
let slot = slots[i];
|
||||||
@ -861,9 +860,7 @@ class Workspace extends St.Widget {
|
|||||||
if (this._windows.length == 0)
|
if (this._windows.length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let workspaceManager = global.workspace_manager;
|
if (this.metaWorkspace !== null && !this.metaWorkspace.active)
|
||||||
let activeWorkspace = workspaceManager.get_active_workspace();
|
|
||||||
if (this.metaWorkspace != null && this.metaWorkspace != activeWorkspace)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Special case maximized windows, since it doesn't make sense
|
// Special case maximized windows, since it doesn't make sense
|
||||||
@ -915,9 +912,7 @@ class Workspace extends St.Widget {
|
|||||||
this._repositionWindowsId = 0;
|
this._repositionWindowsId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let workspaceManager = global.workspace_manager;
|
if (this.metaWorkspace !== null && !this.metaWorkspace.active)
|
||||||
let activeWorkspace = workspaceManager.get_active_workspace();
|
|
||||||
if (this.metaWorkspace != null && this.metaWorkspace != activeWorkspace)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Special case maximized windows, since it doesn't make sense
|
// Special case maximized windows, since it doesn't make sense
|
||||||
@ -981,9 +976,6 @@ class Workspace extends St.Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
zoomFromOverview() {
|
zoomFromOverview() {
|
||||||
let workspaceManager = global.workspace_manager;
|
|
||||||
let currentWorkspace = workspaceManager.get_active_workspace();
|
|
||||||
|
|
||||||
this.leavingOverview = true;
|
this.leavingOverview = true;
|
||||||
|
|
||||||
for (let i = 0; i < this._windows.length; i++)
|
for (let i = 0; i < this._windows.length; i++)
|
||||||
@ -995,7 +987,7 @@ class Workspace extends St.Widget {
|
|||||||
}
|
}
|
||||||
this._overviewHiddenId = Main.overview.connect('hidden', this._doneLeavingOverview.bind(this));
|
this._overviewHiddenId = Main.overview.connect('hidden', this._doneLeavingOverview.bind(this));
|
||||||
|
|
||||||
if (this.metaWorkspace != null && this.metaWorkspace != currentWorkspace)
|
if (this.metaWorkspace !== null && !this.metaWorkspace.active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Position and scale the windows.
|
// Position and scale the windows.
|
||||||
|
@ -549,9 +549,7 @@ var WorkspaceThumbnail = GObject.registerClass({
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// a click on the already current workspace should go back to the main view
|
// a click on the already current workspace should go back to the main view
|
||||||
let workspaceManager = global.workspace_manager;
|
if (this.metaWorkspace.active)
|
||||||
let activeWorkspace = workspaceManager.get_active_workspace();
|
|
||||||
if (this.metaWorkspace == activeWorkspace)
|
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
else
|
else
|
||||||
this.metaWorkspace.activate(time);
|
this.metaWorkspace.activate(time);
|
||||||
|
@ -574,14 +574,13 @@ class WorkspacesDisplay extends St.Widget {
|
|||||||
this._clickAction.release();
|
this._clickAction.release();
|
||||||
|
|
||||||
let workspaceManager = global.workspace_manager;
|
let workspaceManager = global.workspace_manager;
|
||||||
let activeWorkspace = workspaceManager.get_active_workspace();
|
|
||||||
let newWs = workspaceManager.get_workspace_by_index(endProgress);
|
let newWs = workspaceManager.get_workspace_by_index(endProgress);
|
||||||
|
|
||||||
this._scrollAdjustment.ease(endProgress, {
|
this._scrollAdjustment.ease(endProgress, {
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
|
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
|
||||||
duration,
|
duration,
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
if (newWs !== activeWorkspace)
|
if (!newWs.active)
|
||||||
newWs.activate(global.get_current_time());
|
newWs.activate(global.get_current_time());
|
||||||
this._endTouchGesture();
|
this._endTouchGesture();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user