[gnome-shell/gnome-40] ControlsManagerLayout: Use the workarea size to compute the available height
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-40] ControlsManagerLayout: Use the workarea size to compute the available height
- Date: Mon, 16 Aug 2021 00:44:55 +0000 (UTC)
commit 6d087d293bc240064644621081f4444845cf64f1
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date: Fri Jun 18 19:28:55 2021 +0200
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>
(cherry picked from commit f164e086880860a126fde6b6bfa267d8ecbab414)
js/ui/overviewControls.js | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index c153161696..df098ace95 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -131,11 +131,10 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
const { spacing } = this;
- let startY = 0;
- if (Main.layoutManager.panelBox.y === Main.layoutManager.primaryMonitor.y) {
- startY = Main.layoutManager.panelBox.height;
- box.y1 += startY;
- }
+ const monitor = Main.layoutManager.findMonitorForActor(this._container);
+ const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor.index);
+ const startY = workArea.y - monitor.y;
+ box.y1 += startY;
const [width, height] = box.get_size();
let availableHeight = height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]