Repository navigation
feature: add toggle-titlebar and toggle-borders commands - #337
Open
Granitosaurus wants to merge 4 commits into
Open
Granitosaurus wants to merge 4 commits into
Granitosaurus wants to merge 4 commits into
Conversation
Flips the focused window's decoration between `server` and `minimal`, so the title bar goes away while the border, corners and shadow stay. Both modes map to server-side on the wire, so the client is not told; the compositor drops or rebuilds the window's decoration and its cached chrome. Windows that draw their own chrome (`client`) or none are left alone, so a GTK app never gets a second bar. A `minimal` rule window gains a bar on the first toggle. Runtime-only, like `msg opacity`: the override lives on the stored applied rule and is gone when the window closes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rners Review follow-up. - Refresh the cached snap rect: the frame changes by the bar height, and a stale rect read as a grow on the next commit and could relocate a snapped window. - Leave fit, fill and widget windows alone: their geometry was computed against the bar they have, or is rule-defined. - Skip windows that negotiated client-side decoration, so an app with its own header bar never gets a second one. - Carve the opaque-region corners when the bar goes. The compositor clips the corners of a bar-less window itself, but a client that never commits again kept declaring them opaque. The carve moves out of `commit` into `trim_opaque_corners` and is idempotent. - Move the mechanism into state/window_frame.rs, drop the redundant shadow/border cache evictions and the unread `pending_ssd` bookkeeping. - Document the runtime rule rewrite in window-rules.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A runtime flag on the window's stored rule, checked by effective_border_width, effective_shadow_enabled and effective_corner_radius the way `decoration = "none"` already is, so render, layout, snap, fit and IPC all see it through the helpers they already use. The rule's own values stay untouched, so toggling back needs nothing saved. Applies to client-decorated windows too (the compositor draws those three around them as well); left alone for `decoration = "none"`, fullscreen, fit, fill and widget windows, the same guards as toggle-titlebar, which now share a target helper and a post-change step (snap rect refresh, corner carve, redraw). Runtime-only, like `msg opacity`: not saved in session.json, gone when the window closes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rop stale render caches Review fixes: don't write the decoration override when no bar can be created, drop the cached border/shadow elements when chrome changes, skip windows with a deferred fit or fullscreen, document that widget windows are skipped, and tidy the doc comments.
Granitosaurus
marked this pull request as ready for review
November 10, 2026 13:16
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add command to toggle window titlebar and box decorations
A window's chrome (titlebar, border etc) is fixed when it opens:
decoration = "server"in a window rule gives it driftwm's title bar, border, shadow and rounded-corner clip for as long as it lives. There is no way to drop any of it later, and no way to give a bar to a window that opened without one.Concrete case: I use a keyboard-driven image viewer (swayimg) as a picture frame on the canvas, for a transparent gif or a video. I want the title bar while I arrange the window, then nothing around the picture once it sits where I want it. A shadow shows as a dark halo around the transparent parts and the corner clip crops the picture, so removing only the bar is not enough. Today the only route is
decoration = "none"under a secondapp_id, and relaunching the viewer to switch.2026-11-10_20-07-37.mp4
here using these two new actions I can toggle window's chrome for a playing gif in swayimg window
Proposal
Two bindable actions, independent of each other:
toggle-titlebarflips the focused window betweenserverandminimal: the bar goes, border, corners and shadow stay. Both modes areServerSideon the wire, so the client is not told and nothing is reconfigured.toggle-bordershides the border, drop shadow and corner clip together, so the window draws as the bare client surface. It is a runtime flag on the window's stored rule that the existingeffective_border_width/effective_shadow_enabled/effective_corner_radiushelpers check, the way they already honourdecoration = "none". The rule's own values stay untouched, so toggling back restores them with nothing saved.client) or none (none) are left alone by the title bar toggle, so a GTK app never gets a second bar. Fit, fill, fullscreen and widget windows are left alone by both.msg opacity: not saved insession.json, gone when the window closes. No behaviour change for anyone who does not bind them. Both are scriptable throughdriftwm msg action.The only uncertainty I'm having here is to whether toggle-borders should be split further to more granular options like toggle-corners and toggle-shadows bu I think use case just for toggling corners or shadows is likely super rare. However sometimes a user might want to just toggle titlebar as it's not very useful for some programs but retain boxing for navigation (e.g. video player) or just keep the titlebar with no borders for scratchpad #334 windows.