From d2df94da1790808fc5e5792fb445d73fbe5309b8 Mon Sep 17 00:00:00 2001 From: elParaguayo Date: Sat, 12 Oct 2024 07:58:17 +0100 Subject: [PATCH] Fix issue with `group.setlayout` and `TreeTab` When using `group.setlayout` to set the `TreeTab` layout, the side panel is not rendered at all. We can fix this by using the existing method for switching layouts, rather than using the existing approach to set the layout. Fixes #5029 --- libqtile/group.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libqtile/group.py b/libqtile/group.py index 476b6367cd..22b2b88431 100644 --- a/libqtile/group.py +++ b/libqtile/group.py @@ -123,9 +123,7 @@ def layout(self, layout): """ for index, obj in enumerate(self.layouts): if obj.name == layout: - self.current_layout = index - hook.fire("layout_change", self.layouts[self.current_layout], self) - self.layout_all() + self.use_layout(index) return logger.error("No such layout: %s", layout) @@ -135,8 +133,9 @@ def use_layout(self, index: int): self.current_layout = index % len(self.layouts) hook.fire("layout_change", self.layouts[self.current_layout], self) self.layout_all() - screen_rect = self.screen.get_rect() - self.layout.show(screen_rect) + if self.screen is not None: + screen_rect = self.screen.get_rect() + self.layout.show(screen_rect) def use_next_layout(self): self.use_layout((self.current_layout + 1) % (len(self.layouts)))