Skip to content

Commit

Permalink
docking: Use an even width for the overview content area
Browse files Browse the repository at this point in the history
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
  • Loading branch information
3v1n0 committed May 12, 2023
1 parent c681c0c commit e14e26a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e14e26a

Please sign in to comment.