Skip to content

Commit

Permalink
docking: fix window picker space for multi-monitor environments
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky authored and 3v1n0 committed Apr 8, 2024
1 parent 44a4726 commit 1322cf7
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 @@ -2277,7 +2277,31 @@ export class DockManager {
const box = workspaceBoxOriginFixer.call(this, originalFunction, state, ...args);
// GNOME 46 changes "spacing" to "_spacing".
const spacing = this.spacing ?? this._spacing;
return maybeAdjustBoxSize(state, box, spacing);
const dock = DockManager.getDefault().getDockByMonitor(Main.layoutManager.primaryIndex);
if (!dock)
return box;
else
return maybeAdjustBoxSize(state, box, 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 1322cf7

Please sign in to comment.