fix(desktop): honor macOS title-bar double-click preference#1674
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4741b66fc1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The web-based title-bar drag region hardcoded toggleMaximize() on double-click. macOS doesn't act on the drag region itself, so this fought the OS: for users whose "double-click a window's title bar to" preference is Minimize, the window would flicker (maximize/restore or shrink/restore) instead of doing what they set. Add a `title_bar_double_click` Tauri command that reads `AppleActionOnDoubleClick` (Minimize / Maximize / None; defaults to Maximize) and performs the single matching action. Minimize uses AppKit `NSWindow.miniaturize:` directly so the window genies into the Dock like other macOS apps — Tauri's `Window::minimize()` only collapses in place for this window style. Non-macOS keeps the historical maximize toggle. Both double-click handlers (useTauriWindowDrag + StartupWindowDragRegion) now route through a shared `performTitleBarDoubleClickAction()` helper. Signed-off-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co>
4741b66 to
e8de4b2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8de4b26af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Problem
Double-clicking the window title bar flickered instead of doing what the user's macOS setting says. Reported in #buzz-bugs:
The title bar is a web-based drag region, so macOS doesn't act on the double-click itself. The frontend hardcoded
toggleMaximize(), which fought the OS for users whose System Settings → Desktop & Dock → "Double-click a window's title bar to" preference is set to Minimize (or Do Nothing).Fix
title_bar_double_clickreadsAppleActionOnDoubleClick(Minimize/Maximize/None; defaults toMaximizewhen unset) and performs the single matching action — so it never fights the OS.NSWindow.miniaturize:directly, so the window genies into the Dock like other macOS apps. Tauri'sWindow::minimize()only collapses in place for this window style.useTauriWindowDrag.ts+StartupWindowDragRegion.tsx) now route through a sharedperformTitleBarDoubleClickAction()helper.Testing
Built and verified on macOS from a staging worktree: with the system pref set to Minimize, double-clicking the title bar now genies into the Dock (confirmed by the reporter). Maximize/None paths route correctly.
just cifrontend + Rust fmt/clippy/tests pass (pre-push gate green).