Files
buzz/desktop/src/shared/lib/titleBarActions.ts
klopez4212 6b2147a5d1 fix(desktop): honor macOS title-bar double-click preference (#1674)
Signed-off-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co>
2026-07-09 17:27:08 +01:00

23 lines
758 B
TypeScript

import { invoke, isTauri } from "@tauri-apps/api/core";
/**
* Runs the window action that matches the OS "double-click a window's title
* bar to" preference (macOS `AppleActionOnDoubleClick`).
*
* The app uses a web-based title-bar drag region, so the OS does not act on a
* title-bar double-click on its own. The Rust `title_bar_double_click` command
* reads the preference and dispatches a single matching action (native
* `miniaturize:` for minimize, so the window genies into the Dock).
*/
export async function performTitleBarDoubleClickAction(): Promise<void> {
if (!isTauri()) {
return;
}
try {
await invoke("title_bar_double_click");
} catch {
// No-op on failure; a missed titlebar action is not worth surfacing.
}
}