From e14e26a096e7218314e53915eafc0aadeadd1cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 10 Oct 2022 00:42:21 +0200 Subject: [PATCH] docking: Use an even width for the overview content area For some reason we need to use an even value, this is probably due to the fact that such value is going to be proportional to the available space. Closes: #1612 LP: #1979096 --- docking.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docking.js b/docking.js index ab0ec9b1b..a938476f8 100644 --- a/docking.js +++ b/docking.js @@ -2114,7 +2114,13 @@ var DockManager = class DashToDock_DockManager { if (this.mainDock.isHorizontal || this.settings.dockFixed) return box; - const [, preferredWidth] = this.mainDock.get_preferred_width(box.get_height()); + let [, preferredWidth] = this.mainDock.get_preferred_width(box.get_height()); + + // For some reason we need to use an even value for the box area + // or we may end up in allocation issues: + // https://github.com/micheleg/dash-to-dock/issues/1612 + preferredWidth = Math.floor(preferredWidth / 2.0) * 2 + box.x2 -= preferredWidth; if (this.mainDock.position === St.Side.LEFT) box.set_origin(box.x1 + preferredWidth, box.y1);