fix(gui): draw a client-side titlebar on Linux for window controls#338
fix(gui): draw a client-side titlebar on Linux for window controls#338stefan-siebert wants to merge 1 commit into
Conversation
Greptile SummaryThis PR adds Linux client-side titlebars while keeping native titlebars elsewhere.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(gui): draw a client-side titlebar on..." | Re-trigger Greptile |
On Linux all windows used `appears_transparent: false`; the compositor declines server-side decorations and gpui falls back to client-side decorations it does not paint, leaving every window with no titlebar and no window controls (minimize / maximize / close). macOS and Windows were unaffected (their native titlebar works), so the fix is scoped to Linux. On Linux only: - window options use gpui-component's `TitleBar::title_bar_options()` (transparent native chrome) via the shared `windows::titlebar_options` helper, for the main window (main.rs) and the aux-window opener (windows/mod.rs); macOS/Windows keep the original native options; - the main view (app.rs) and each auxiliary view (Settings, Add Device, Update Consent) render a gpui-component `TitleBar` at the top — via the shared `windows::aux_title_bar` helper — gated behind `cfg!(target_os = "linux")`, giving Linux window controls + a drag region. The Settings window uses an absolute-overlay titlebar (with matching top padding) because its `h_resizable` sidebar uses percentage sizing a flex column would break. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4ceecc8 to
24ecc49
Compare
|
Thanks! Good catch on "Settings Title Skips Localization" — that was a real inconsistency I introduced ( Fixed in the latest push. I localized it in both places for the Settings window, to match the
Builds + |
|
Heads up @stefan-siebert — #191 also edits |
|
Quick heads-up: #191 also touches When it happens, it's a take-both: keep this PR's new imports ( One thing to watch: this branch still has |
Problem
On Linux every window opens with no titlebar and no window controls (minimize / maximize / close). All windows use
appears_transparent: false, but on Linux the compositor declines server-side decorations and gpui falls back to client-side decorations it does not paint — so there's nothing to drag and no controls. macOS and Windows are unaffected (their native titlebar works), so this is a Linux-only gap.Startup log on Wayland:
Fix
Draw gpui-component's
TitleBar(window controls + drag region) on Linux, scoped behindcfg!(target_os = "linux")so macOS and Windows keep their native titlebar unchanged:windows::titlebar_options()helper: on Linux it returnsTitleBar::title_bar_options()(transparent native chrome); on macOS/Windows it returns the original native options. Used by the main window (main.rs) and the aux-window opener (windows/mod.rs).app.rs) and each auxiliary view — Settings, Add Device, Update Consent — render aTitleBarat the top via a sharedwindows::aux_title_bar()helper, each gated on Linux.h_resizablesidebar uses percentage sizing that a flex column would break.Scope & testing
TitleBaris only added undercfg!(target_os = "linux"). (The one non-gated change, an innerflex_1wrapper in two aux views, is visually neutral.)clippyclean, the app launches and the window stays up with the client-side titlebar on the CSD path.🤖 Generated with Claude Code