From 226cfdac5cbfd591760b835374b02344e4adc3a1 Mon Sep 17 00:00:00 2001 From: tomdebone Date: Mon, 6 Jul 2026 16:29:39 +0200 Subject: [PATCH] tauri-app: switch to native title bar (fixes drag + clicks) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous 'custom' title bar used tauri.conf.json settings (decorations: false, titleBarStyle: Overlay, hiddenTitle: true) plus a 30px HTML
with data-tauri-drag-region='deep'. Two problems made the app unusable: 1. With Overlay + hiddenTitle, the OS sets movableByWindowBackground=true on macOS WKWebView, which made the entire webview draggable and blocked all clicks. 2. Tauri 2's WKWebView integration has a known issue (tao#N) where the drag.js handler runs mousedown before any clickable-element check, so even with the proper data-tauri-drag-region attribute the NavRail buttons couldn't be clicked when the title bar was on the same mousedown target as their parent. Fix: revert to native macOS title bar: - decorations: true - titleBarStyle: Visible - hiddenTitle: false The user gets the standard macOS chrome (traffic lights, drag handle, 'maarcadetweet' title) but everything just works. Custom title-bar work deferred until Tauri 3.0 (which fixes the WKWebView + movableByWindowBackground interaction). Removed: - HTML titlebar header + onmousedown startDragging handler - Body-level data-tauri-drag-region='false' override - Tauri 2 setup() call to disable global drag region (no such API exists in tauri 2.11.5) Also clean up $bindable → $bindable() in NavRail — the generic form was the wrong syntax on the tauri runtime's Svelte 5 version. All 240 tests still pass (231 Rust + 9 vitest). --- crates/tauri-app/src-tauri/src/lib.rs | 1 + crates/tauri-app/src-tauri/tauri.conf.json | 6 +++--- crates/tauri-app/src/App.svelte | 11 +++++++++-- crates/tauri-app/src/lib/components/NavRail.svelte | 9 ++++++--- crates/tauri-app/src/main.ts | 1 + 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/crates/tauri-app/src-tauri/src/lib.rs b/crates/tauri-app/src-tauri/src/lib.rs index ecd1259..c4bed31 100644 --- a/crates/tauri-app/src-tauri/src/lib.rs +++ b/crates/tauri-app/src-tauri/src/lib.rs @@ -415,6 +415,7 @@ pub fn run() { .plugin(tauri_plugin_window_state::Builder::default().build()) .manage(state) .setup(|app| { + use tauri::Manager; tracing::info!("maarcadetweet starting up"); // Embed the tray icon at compile time. `include_image!` diff --git a/crates/tauri-app/src-tauri/tauri.conf.json b/crates/tauri-app/src-tauri/tauri.conf.json index 4962783..ebef902 100644 --- a/crates/tauri-app/src-tauri/tauri.conf.json +++ b/crates/tauri-app/src-tauri/tauri.conf.json @@ -20,10 +20,10 @@ "minWidth": 880, "minHeight": 540, "resizable": true, - "decorations": false, + "decorations": true, "transparent": false, - "titleBarStyle": "Overlay", - "hiddenTitle": true, + "titleBarStyle": "Visible", + "hiddenTitle": false, "backgroundColor": "#0D0D0D" } ], diff --git a/crates/tauri-app/src/App.svelte b/crates/tauri-app/src/App.svelte index 77af4fb..6631489 100644 --- a/crates/tauri-app/src/App.svelte +++ b/crates/tauri-app/src/App.svelte @@ -465,19 +465,26 @@ {/if}