Skip to content

fix(awful.titlebar): honor the urgent state for titlebar buttons#4107

Open
keryell wants to merge 1 commit into
awesomeWM:masterfrom
keryell:fix-titlebar-urgent-buttons
Open

fix(awful.titlebar): honor the urgent state for titlebar buttons#4107
keryell wants to merge 1 commit into
awesomeWM:masterfrom
keryell:fix-titlebar-urgent-buttons

Conversation

@keryell

@keryell keryell commented Jun 18, 2026

Copy link
Copy Markdown

Problem

awful.titlebar already selects an urgent variant for the titlebar background and foreground (via get_color()), but the titlebar button widget (titlebar.widget.button) only distinguished the normal and focus states, and was not redrawn when a client's urgent property changed. As a result, an urgent (but unfocused) client kept showing its normal button images on top of the urgent-colored titlebar background.

Fix

  • Select button images by client state with an ordered, graceful fallback: urgent → focus → normal. Themes that ship dedicated titlebar_*_button_urgent* images get them; themes that don't fall back to the existing focus/normal images, so no existing theme changes behavior.
  • Redraw the button on property::urgent.

Compatibility

The fallback keeps the lookup identical for the normal and focus states on every existing theme. The default/xresources themes ship no _urgent button images, so urgent windows now show the focus glyphs instead of the normal ones — matching the already-urgent-aware titlebar background/foreground.

Testing

Built and ran on a live session (awesome v4.3 HEAD + this commit). Verified with a window forced urgent while unfocused: the titlebar buttons now follow the urgent/focus image set and update immediately when the urgent flag is set or cleared; normal and focused windows render their buttons unchanged.

🤖 Generated with Claude Code

The titlebar background and foreground already select an "urgent" variant
via get_color(), but the button image widget only distinguished the
"normal" and "focus" states and was not redrawn when a client's urgent
property changed. An urgent client therefore kept showing its "normal"
button images.

Select button images by client state with graceful fallback
(urgent -> focus -> normal), so themes that ship no dedicated urgent
button images keep working unchanged, and redraw the buttons on
property::urgent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@Aire-One Aire-One left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seems reasonable to me. But the new behavior needs to be documented in the API doc and beautiful variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants