Skip to content

titlebar: Follow Linux window button layouts - #4018

Merged
madcodelife merged 1 commit into
longbridge:mainfrom
ManasDasri:titlebar-linux-button-layout
Nov 17, 2026
Merged

madcodelife merged 1 commit into
longbridge:mainfrom
ManasDasri:titlebar-linux-button-layout

Conversation

@ManasDasri

Copy link
Copy Markdown
Contributor

Summary

The Linux TitleBar currently hard-codes its controls on the trailing side in minimize/maximize/close order, even though the GPUI platform provides a WindowButtonLayout and notifies windows when the host layout changes.

This change reads that layout, renders controls on the configured side in order, and observes layout changes so the title bar redraws when the user changes desktop settings. It continues to filter minimize/maximize using the window manager's supported-control flags. Windows and macOS retain their current layout and behavior.

This covers the Linux placement and live-update part of #3994. The controls remain GPUI elements styled with GPUI Component theme tokens and icons. The pinned GPUI API exposes button layout, but not GTK/Qt widget CSS, icon themes, or per-control spacing; this PR does not link or embed GTK or Qt widgets.

Validation

  • cargo test -p gpui-component --lib title_bar::tests — 5 passed.
  • cargo clippy -p gpui-component --lib --tests --no-deps -- -D warnings — passed for the changed crate.
  • cargo fmt --all -- --check — passed.
  • git diff --check — passed.

A full workspace Clippy run is currently blocked by the existing drop_non_drop warning at crates/base/src/input/editor/display_map/text_wrapper.rs:924.

@huacnlee

Copy link
Copy Markdown
Member

✅ LGTM with one note: Linux TitleBar now follows the desktop's window button layout and live updates; no public API change.

  • Reviewed head 03761cb. Scope: Linux-only placement of the caption buttons via GPUI's WindowButtonLayout + observe_button_layout_changed; Windows/macOS unchanged. Capability filtering (minimize/maximize) is kept, close is always shown.
  • Ran cargo test -p gpui-component --lib title_bar locally: 6 passed.
  • Note (RTL): on Linux the bar is forced to flex_row() / pl(...), so RTL no longer mirrors there. GTK mirrors decoration-layout in RTL, so consider swapping left/right when the app direction is RTL instead of dropping mirroring, to keep RTL framework-wide.
  • CI has not run yet on this branch (needs maintainer approval for the first run). Not verified visually on a GNOME/KDE session.

🤖 Noop (reviewer) · AI agent acting for @huacnlee

@madcodelife
madcodelife merged commit cd2fe14 into longbridge:main Nov 17, 2026
17 of 18 checks passed
@madcodelife

Copy link
Copy Markdown
Member

Thank you!

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.

3 participants