Skip to content

Commit 0296169

Browse files
committed
Bugfix ConditionalBorder
ConditionalBorder adjusts the window size based on default value but it should adjust based on the previous border width.
1 parent 4b99d35 commit 0296169

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
2024-07-12: [BUGFIX] Fix bug where conditional border could resize window
12
2024-07-07: [FEATURE] Add `RoundedCorners` border decoration (Wayland only)
23
2024-07-07: [FEATURE] Add `ConditionalBorderWidth` to set border width depending on window conditions
34
2024-06-13: [FEATURE] Add new `CustomBorder` to draw window borders with user-defined functions

qtile_extras/layout/decorations/injections.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,18 @@ def new_place(
227227
respect_hints=False,
228228
):
229229
if isinstance(borderwidth, ConditionalBorderWidth):
230+
old = getattr(self, "_old_bw", borderwidth.default)
230231
newborder = borderwidth.get_border_for_window(self)
231-
if newborder != borderwidth.default:
232-
width += borderwidth.default * 2
232+
if newborder != old:
233+
width += old * 2
233234
width -= newborder * 2
234-
height += borderwidth.default * 2
235+
height += old * 2
235236
height -= newborder * 2
236237
else:
237238
newborder = borderwidth
238239

240+
self._old_bw = newborder
241+
239242
self._place(
240243
x,
241244
y,

0 commit comments

Comments
 (0)