Skip to content

Commit

Permalink
Bugfix ConditionalBorder
Browse files Browse the repository at this point in the history
ConditionalBorder adjusts the window size based on default value but it
should adjust based on the previous border width.
  • Loading branch information
elParaguayo committed Jul 12, 2024
1 parent 4b99d35 commit 0296169
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
2024-07-12: [BUGFIX] Fix bug where conditional border could resize window
2024-07-07: [FEATURE] Add `RoundedCorners` border decoration (Wayland only)
2024-07-07: [FEATURE] Add `ConditionalBorderWidth` to set border width depending on window conditions
2024-06-13: [FEATURE] Add new `CustomBorder` to draw window borders with user-defined functions
Expand Down
9 changes: 6 additions & 3 deletions qtile_extras/layout/decorations/injections.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,18 @@ def new_place(
respect_hints=False,
):
if isinstance(borderwidth, ConditionalBorderWidth):
old = getattr(self, "_old_bw", borderwidth.default)
newborder = borderwidth.get_border_for_window(self)
if newborder != borderwidth.default:
width += borderwidth.default * 2
if newborder != old:
width += old * 2
width -= newborder * 2
height += borderwidth.default * 2
height += old * 2
height -= newborder * 2
else:
newborder = borderwidth

self._old_bw = newborder

self._place(
x,
y,
Expand Down

0 comments on commit 0296169

Please sign in to comment.