Drop relayout as the cover pane now uses whole stage

This commit is contained in:
Charles Gagnon
2022-04-05 17:58:47 -04:00
parent 5a9b010cde
commit aa14940705
2 changed files with 4 additions and 26 deletions

View File

@@ -313,7 +313,7 @@ var Panel = GObject.registerClass({
() => {
if (this.isPrimary) {
//reset the primary monitor when exiting the overview
this.panelManager.setFocusedMonitor(this.monitor, true);
this.panelManager.setFocusedMonitor(this.monitor);
}
}
],
@@ -323,7 +323,7 @@ var Panel = GObject.registerClass({
(actor, e) => {
if (e.type() == Clutter.EventType.BUTTON_PRESS || e.type() == Clutter.EventType.TOUCH_BEGIN) {
//temporarily use as primary the monitor on which the activities btn was clicked
this.panelManager.setFocusedMonitor(this.monitor, true);
this.panelManager.setFocusedMonitor(this.monitor);
}
}
],

View File

@@ -153,9 +153,6 @@ var PanelManager = class {
this._enableHotCornersId = Main.layoutManager._interfaceSettings.connect('changed::enable-hot-corners', () => Main.layoutManager._updateHotCorners());
}
this._oldOverviewRelayout = Main.overview._relayout;
Main.overview._relayout = this._newOverviewRelayout.bind(Main.overview);
this._oldUpdateWorkspacesViews = Main.overview._overview._controls._workspacesDisplay._updateWorkspacesViews;
Main.overview._overview._controls._workspacesDisplay._updateWorkspacesViews = this._newUpdateWorkspacesViews.bind(Main.overview._overview._controls._workspacesDisplay);
@@ -339,9 +336,6 @@ var PanelManager = class {
Main.layoutManager._updatePanelBarrier = this._oldUpdatePanelBarrier;
Main.layoutManager._updatePanelBarrier();
Main.overview._relayout = this._oldOverviewRelayout;
Main.overview._relayout();
Main.overview._overview._controls._workspacesDisplay._updateWorkspacesViews = this._oldUpdateWorkspacesViews;
Utils.getPanelGhost().set_size(-1, -1);
@@ -363,33 +357,17 @@ var PanelManager = class {
delete Main.panel.style;
}
setFocusedMonitor(monitor, ignoreRelayout) {
setFocusedMonitor(monitor) {
this._needsIconAllocate = 1;
if (!this.checkIfFocusedMonitor(monitor)) {
Main.overview._overview._controls._workspacesDisplay._primaryIndex = monitor.index;
Main.overview._overview.clear_constraints();
Main.overview._overview.add_constraint(new Layout.MonitorConstraint({ index: monitor.index }));
if (ignoreRelayout) return;
this._newOverviewRelayout.call(Main.overview);
Main.overview._overview._controls._workspacesDisplay._primaryIndex = monitor.index;
}
}
_newOverviewRelayout() {
// To avoid updating the position and size of the workspaces
// we just hide the overview. The positions will be updated
// when it is next shown.
this.hide();
let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.overview._overview._controls._workspacesDisplay._primaryIndex);
this._coverPane.set_position(0, workArea.y);
this._coverPane.set_size(workArea.width, workArea.height);
}
_newUpdateWorkspacesViews() {
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].destroy();