Update overview workarea on monitor focus change

#2183
This commit is contained in:
Charles Gagnon
2025-01-19 13:40:05 -05:00
parent 802b25321b
commit 002b96652c
2 changed files with 9 additions and 1 deletions

View File

@@ -128,7 +128,7 @@ export const Overview = class {
else
box[focusedPanel.fixedCoord.c1] += size
} else if (isBottom)
// The default overview allocation is very good and takes into account external
// The default overview allocation takes into account external
// struts, everywhere but the bottom where the dash is usually fixed anyway.
// If there is a bottom panel under the dash location, give it some space here
box.y2 -= focusedPanel.geom.h

View File

@@ -328,6 +328,14 @@ export const PanelManager = class {
Main.overview._overview.add_constraint(new Layout.MonitorConstraint({ index: monitor.index }));
Main.overview._overview._controls._workspacesDisplay._primaryIndex = monitor.index;
// https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2395
// The overview allocation used to calculate its workarea based on the monitor where the overview
// was displayed, but it got changed back to always use the primary monitor. So now, temporarily assign
// the primary monitor to dtp focused monitor while recalculating the overview workarea
Main.layoutManager.primaryMonitor = monitor
Main.overview._overview._controls.layout_manager._updateWorkAreaBox()
Main.layoutManager.primaryMonitor = Main.layoutManager.monitors[Main.layoutManager.primaryIndex]
}
}