ControlsManagerLayout: Use the workarea size to compute the available height

To compute the available height for the layout we're currently using the
panel position, while this works for the current and default setup, the
shell may be configured to use a different workarea, so we should rely on
it to compute the available space, instead of a specific widget.

So get the current monitor index for the current view and use its coordinates
instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1892>
This commit is contained in:
Marco Trevisan (Treviño) 2021-06-18 19:28:55 +02:00 committed by Florian Müllner
parent f30fa1adc7
commit f164e08688

View File

@ -131,11 +131,10 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
const { spacing } = this; const { spacing } = this;
let startY = 0; const monitor = Main.layoutManager.findMonitorForActor(this._container);
if (Main.layoutManager.panelBox.y === Main.layoutManager.primaryMonitor.y) { const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor.index);
startY = Main.layoutManager.panelBox.height; const startY = workArea.y - monitor.y;
box.y1 += startY; box.y1 += startY;
}
const [width, height] = box.get_size(); const [width, height] = box.get_size();
let availableHeight = height; let availableHeight = height;