Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bar: finalize drawer before recreating it #4842

Merged
merged 1 commit into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions libqtile/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import asyncio
from typing import Any

from libqtile.backend.base import Internal, WindowType
from libqtile.backend.base import Drawer, Internal, WindowType
from libqtile.command.base import ItemT
from libqtile.config import Screen
from libqtile.core.manager import Qtile
Expand Down Expand Up @@ -200,6 +200,7 @@ def __init__(self, widgets: list[_Widget], size: int, **config: Any) -> None:
# bar as python is referring to the same list.
self.widgets = widgets.copy()
self.window: Internal | None = None
self.drawer: Drawer
self._configured = False
self._draw_queued = False
self.future: asyncio.Handle | None = None
Expand Down Expand Up @@ -323,9 +324,11 @@ def _configure(self, qtile: Qtile, screen: Screen, reconfigure: bool = False) ->
self.window.process_pointer_motion = self.process_pointer_motion
self.window.process_key_press = self.process_key_press

# We create a new drawer even if there's already a window to ensure the
# drawer is the right size.
self.drawer = self.window.create_drawer(width, height)
if hasattr(self, "drawer"):
self.drawer.width = width
self.drawer.height = height
else:
self.drawer = self.window.create_drawer(width, height)
self.drawer.clear(self.background)

crashed_widgets: set[_Widget] = set()
Expand Down