fix(gui): draw a client-side titlebar on Linux for window controls#338
Open
stefan-siebert wants to merge 1 commit into
Open
fix(gui): draw a client-side titlebar on Linux for window controls#338stefan-siebert wants to merge 1 commit into
stefan-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
Author
|
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 + |
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.
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