Skip to content

DRAFT: feat: title label - #588

Draft
devojoni wants to merge 9 commits into
wlrfx:masterfrom
devojoni:feature/title-label
Draft

devojoni wants to merge 9 commits into
wlrfx:masterfrom
devojoni:feature/title-label

Conversation

@devojoni

@devojoni devojoni commented Sep 16, 2026

Copy link
Copy Markdown

Summary

NOTE: This is a feature I found myself thinking about a lot. This was implemented with the heavy use of Claude. I put this pull request up just in case someone else would like to take ownership of this feature and maybe finds some worth in the code. In all honesty I don't understand all of the code properly and have most likely misunderstood a good chunk of the rest.

Adds a label decoration mode — a small floating title chip that overlaps window content instead of reserving a full-width titlebar strip. Configurable edge/alignment, max width (px or %), corner radius (fixed or match-window), focus-based autohide, and cursor-avoidance slide. Works independently of border mode; suppresses the reserved titlebar strip when combined with border normal. Applies to leaf view containers (tabbed/stacked tab-strip entries are unaffected — out of scope for v1).

New command: label enable|disable|toggle|position|max_width|corner_radius|autohide|avoid_cursor (see sway.5 for full syntax — man page entry included in this PR).

Test plan

  • label enable on tiled + floating windows, all four border modes (none/pixel/normal/csd) — content fills the window, no reserved strip, label renders sized to the title text (not window width).
  • label position all 6 combinations; max_width in both px and % form, confirm it never exceeds the window width.
  • label corner_radius vs match (including live-follow when the window's own corner_radius changes at runtime).
  • border normal + label enable together on the same window — only the label shows, never both.
  • Drag on the label behaves like a normal titlebar; clicks outside its bounds pass through to content.
  • label autohide : label shows on focus, fades after the delay regardless of continued focus; losing focus always restores full visibility immediately.
  • label avoid_cursor on: label slides away from the pointer and back; hovering also cancels a pending autohide fade.

Known limitations

  • Tabbed/stacked tab-strip entries donign, v1 scope). A few minor polish items remain (docon-finite max_width/corner_radius input isn't rejected, avoid-cursor sweeps er than just the visible output.

Some screenshots and clips

With window border
label_basic_render_border_2px
Without window border
label_basic_redner_border_none

Different positions
label_bottom_left
label_bottom_middle
label_bottom_right
label_top_left
label_top_middle
label_top_right

Different radi
label_corner_radius

Maximum width
label_max_width

label_drag.mp4
label_autohide.mp4
label_avoid_cursor.mp4

devojoni and others added 9 commits September 10, 2026 13:15
Compact floating title label alternative to full titlebar, positioned
by edge/alignment, capped to window width, with configurable corner
radius, autohide-on-unfocus, and avoid-cursor slide.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
9-task breakdown covering data model, content-box geometry, scene
positioning, corner radius, the label command, titlebar suppression,
focus-based autohide fade, and avoid-cursor slide.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@devojoni
devojoni marked this pull request as draft September 16, 2026 11:11
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.

1 participant