Skip to content

Commit

Permalink
Fix background bug for mirrored widgets
Browse files Browse the repository at this point in the history
Since the refactoring of the `Drawer` class, widget backgrounds are now
drawn to the drawer's RecordingSurface. However, `Mirror.draw` paints
the widget background with the background colour before copying the
contents of the recording surface. This means that the background is
painted twice, causing issues where widgets had semi translucent
backgrounds.

This PR fixes the issue by clearing the drawer before copying the
recording surface.

Fixes #4589
  • Loading branch information
elParaguayo committed Feb 6, 2024
1 parent 0aca7be commit e11aec2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libqtile/widget/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ def length(self, value):
self._length = value

def draw(self):
self.drawer.clear(self.reflects.background or self.bar.background)
self.drawer.clear_rect()
self.reflects.drawer.paint_to(self.drawer)
self.drawer.draw(offsetx=self.offset, offsety=self.offsety, width=self.width)

Expand Down

0 comments on commit e11aec2

Please sign in to comment.