Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: custom title bar with native decorations disabled (#65)#91

Open
diegoQuinas wants to merge 2 commits into
berbicanes:main from
diegoQuinas:feat/65-custom-titlebar
Open

feat: custom title bar with native decorations disabled (#65) #91
diegoQuinas wants to merge 2 commits into
berbicanes:main from
diegoQuinas:feat/65-custom-titlebar

Conversation

@diegoQuinas

@diegoQuinas diegoQuinas commented Jun 5, 2026

Copy link
Copy Markdown

Closes #65

Problem

On KDE Plasma, ApiArk renders with GTK's client-side decorations (CSD), producing an oversized, Gnome-style header bar that looks out of place and breaks visual consistency under KWin (which uses server-side decorations).

Solution

Disable the native OS window decorations and draw a unified frontend title bar, the same approach used by VS Code, Postman, Insomnia and Discord.

Hybrid per-platform strategy:

  • Windows / Linux — native decorations off + a custom title bar with minimize / maximize-restore / close buttons.
  • macOS — keeps its native traffic-light controls via titleBarStyle: "Overlay" (no custom buttons), rendering only a draggable strip that reserves space for them, so Mac users keep the familiar window controls.

Implementation notes

  • The macOS behaviour lives in a new tauri.macos.conf.json. Tauri merges platform configs with JSON Merge Patch (RFC 7396), which replaces arrays rather than merging them, so the override duplicates the full app.windows[0] object plus titleBarStyle: "Overlay". The base config sets decorations: false; the macOS override omits it (defaults to true) so the traffic lights stay. This is flash-free on all three platforms — no runtime decoration toggling.
  • open_new_window mirrors the same per-platform behaviour via #[cfg]-gated builder calls.
  • Adds the core:window permissions the drag region and controls need: allow-minimize, allow-toggle-maximize, allow-is-maximized, allow-start-dragging.
  • New titleBar i18n namespace added across all nine locales for the control aria-labels.

Known tradeoff

Undecorated windows on Linux (especially Wayland) lose the native resize borders. This is inherent to disabling decorations, which is exactly what the issue requested; window managers still allow keyboard/edge resize, and a future follow-up could add custom resize grips if desired.

Verification

  • tsc -b — passes (validates the full Tauri window JS API usage).
  • eslint — no new errors.
  • cargo check — passes; this validates the base config and all four new capability permissions at generate_context! time.
  • macOS title_bar_style / TitleBarStyle::Overlay confirmed against the official Tauri 2 window-customization docs.

Testing

Built and type/compile-checked on Linux. Manual smoke test of the rendered controls on macOS hardware would be a welcome confirmation before release, since the Overlay path is the one branch a Linux build does not exercise.

On KDE Plasma the GTK client-side decorations render an oversized,
Gnome-style header that looks out of place. Disable the native OS window
decorations and draw a unified frontend title bar instead, matching the
approach used by VS Code, Postman and Discord.
Hybrid per-platform strategy:
- Windows/Linux: decorations off + custom minimize/maximize/close buttons.
- macOS: keep the native traffic-light controls via titleBarStyle "Overlay"
 (no custom buttons), with a draggable strip that reserves space for them.
The macOS override lives in tauri.macos.conf.json; since Tauri merges
platform configs via JSON Merge Patch (RFC 7396), which replaces arrays,
it duplicates the full window object plus the overlay title-bar style.
Adds the core:window permissions needed by the drag region and controls,
and a titleBar i18n namespace across all nine locales.
With titleBarStyle Overlay, macOS still draws the native window title,
which overlapped the custom title bar span and produced a doubled,
ghosted "ApiArk" (issue berbicanes#65). Set hiddenTitle so only the custom bar
renders. Applied to both the config window and open_new_window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[UI/Feature Request] Gnome-style window decorations on KDE Plasma & Suggestion for a custom title bar

1 participant

AltStyle によって変換されたページ (->オリジナル) /