Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docking: fix window picker space for multi-monitor environments #2158

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading