-
Notifications
You must be signed in to change notification settings - Fork 57
feat: custom title bar with native decorations disabled (#65)#91
Open
diegoQuinas wants to merge 2 commits into
Open
feat: custom title bar with native decorations disabled (#65) #91diegoQuinas wants to merge 2 commits into
diegoQuinas wants to merge 2 commits into
Conversation
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.
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.
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:
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
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 fullapp.windows[0]object plustitleBarStyle: "Overlay". The base config setsdecorations: false; the macOS override omits it (defaults totrue) so the traffic lights stay. This is flash-free on all three platforms — no runtime decoration toggling.open_new_windowmirrors the same per-platform behaviour via#[cfg]-gated builder calls.core:windowpermissions the drag region and controls need:allow-minimize,allow-toggle-maximize,allow-is-maximized,allow-start-dragging.titleBari18n namespace added across all nine locales for the controlaria-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 atgenerate_context!time.title_bar_style/TitleBarStyle::Overlayconfirmed 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.