Skip to content

Commit

Permalink
Fix issue with group.setlayout and TreeTab
Browse files Browse the repository at this point in the history
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 qtile#5029
  • Loading branch information
elParaguayo committed Oct 13, 2024
1 parent d13eb3d commit d2df94d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libqtile/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)))
Expand Down

0 comments on commit d2df94d

Please sign in to comment.