Skip to content

fix(desktop): honor macOS title-bar double-click preference#1674

Merged
klopez4212 merged 3 commits into
mainfrom
fix/titlebar-doubleclick-macos-pref
Jul 9, 2026
Merged

fix(desktop): honor macOS title-bar double-click preference#1674
klopez4212 merged 3 commits into
mainfrom
fix/titlebar-doubleclick-macos-pref

Conversation

@klopez4212

Copy link
Copy Markdown
Contributor

Problem

Double-clicking the window title bar flickered instead of doing what the user's macOS setting says. Reported in #buzz-bugs:

Double clicking a small window maximizes it for a moment, but then returns to the old size right away — and double clicking a maximized window makes it go small for a moment, then returns to maximized.

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

  • New Tauri command title_bar_double_click reads AppleActionOnDoubleClick (Minimize / Maximize / None; defaults to Maximize when unset) and performs the single matching action — so it never fights the OS.
  • 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.
  • Both double-click handlers (useTauriWindowDrag.ts + StartupWindowDragRegion.tsx) now route through a shared performTitleBarDoubleClickAction() helper.
  • Non-macOS platforms keep the historical maximize toggle.

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 ci frontend + Rust fmt/clippy/tests pass (pre-push gate green).

@klopez4212 klopez4212 requested a review from a team as a code owner July 9, 2026 14:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread desktop/src-tauri/src/lib.rs
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>
@klopez4212 klopez4212 force-pushed the fix/titlebar-doubleclick-macos-pref branch from 4741b66 to e8de4b2 Compare July 9, 2026 15:11

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread desktop/src-tauri/src/lib.rs Outdated
@klopez4212 klopez4212 merged commit 6b2147a into main Jul 9, 2026
25 checks passed
@klopez4212 klopez4212 deleted the fix/titlebar-doubleclick-macos-pref branch July 9, 2026 16:27
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.

2 participants