overviewControls: Don't update work area box when headless

When headless, we don't have a monitor we can derive a size from, so
don't even try, just let it be updated when we actually have a monitor
that will show stuff.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5831
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2478>
This commit is contained in:
Jonas Ådahl 2022-09-08 12:31:15 +02:00 committed by Marge Bot
parent 5548f98afc
commit fe9c2b8df6

View File

@ -55,6 +55,9 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
_updateWorkAreaBox() {
const monitor = Main.layoutManager.primaryMonitor;
if (!monitor)
return;
const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor.index);
const startX = workArea.x - monitor.x;
const startY = workArea.y - monitor.y;