Skip to content

Commit

Permalink
docking: fix window picker space for multi-monitor enviroments
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Mar 16, 2024
1 parent e48a602 commit 149b1f5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,31 @@ export class DockManager {
return originalFunction.call(this, state, ...args);

const box = workspaceBoxOriginFixer.call(this, originalFunction, state, ...args);
return maybeAdjustBoxSize(state, box, this.spacing);
const dock = DockManager.getDefault().getDockByMonitor(Main.layoutManager.primaryIndex);
if (!dock)
return box;
else
return maybeAdjustBoxSize(state, box, this.spacing);
/* eslint-enable no-invalid-this */
},
], [
WorkspacesView.SecondaryMonitorDisplay.prototype,
'_getWorkspacesBoxForState',
function (originalFunction, state, ...args) {
/* eslint-disable no-invalid-this */
if (state === OverviewControls.ControlsState.HIDDEN)
return originalFunction.call(this, state, ...args);

const box = workspaceBoxOriginFixer.call(this, originalFunction, state, ...args);
const dock = DockManager.getDefault().getDockByMonitor(this._monitorIndex);
if (!dock)
return box;
if (state === OverviewControls.ControlsState.WINDOW_PICKER &&
dock.position === St.Side.BOTTOM) {
const [, preferredHeight] = dock.get_preferred_height(box.get_width());
box.y2 -= preferredHeight;
}
return box;
/* eslint-enable no-invalid-this */
},
], [
Expand Down

0 comments on commit 149b1f5

Please sign in to comment.