Skip to content

Commit

Permalink
fix(layout): don't attempt xcb hack under wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
aravinda0 committed May 2, 2024
1 parent 03c328c commit a5d8490
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/qtile_bonsai/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ def render(self, screen_rect: ScreenRect, tree: "BonsaiTree"):
self.bar_drawer.width = bar_rect.w
self.bar_drawer.height = bar_rect.h

# NOTE: This hack is a workaround after some changes in qtile 0.23. When the
# drawer surface width expands, the xcb surface is freed, but not re-created.
# NOTE: This hack is a workaround after some changes in qtile 0.23 under X. When
# the drawer surface width expands, the xcb surface is freed, but not
# re-created. No problem under Wayland.
# Re-creation only happens later when `drawer._check_xcb()` is invoked in
# `drawer.draw()`. But that check doesn't happen in `drawer.clear()`, and
# that's when we face an exception.
self.bar_drawer._check_xcb()
if hasattr(self.bar_drawer, "_check_xcb"):
self.bar_drawer._check_xcb()

self.bar_drawer.clear(tab_bar_bg_color)

Expand Down

0 comments on commit a5d8490

Please sign in to comment.