Skip to content

Commit f95441d

Browse files
committed
Title bar: Restore dblclick-to-zoom on macOS
- Replace the JS `onmousedown` → `startDragging()` handler with the `data-tauri-drag-region` attribute. - Tauri's drag region handles drag and double-click-to-zoom natively, matching the macOS standard title bar behavior (respects System Settings → Desktop & Dock → "Double-click a window's title bar to"). - Drop the `a11y_no_static_element_interactions` Svelte warning ignore — no longer needed.
1 parent dcfe439 commit f95441d

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

apps/desktop/src/routes/(main)/+page.svelte

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -345,19 +345,6 @@
345345
}
346346
}
347347
348-
/** Start window drag when title bar is clicked */
349-
async function handleTitleBarMouseDown(e: MouseEvent) {
350-
if (e.buttons === 1) {
351-
e.preventDefault() // Prevent focus shift away from explorer
352-
try {
353-
const { getCurrentWindow } = await import('@tauri-apps/api/window')
354-
await getCurrentWindow().startDragging()
355-
} catch {
356-
// Not in Tauri environment
357-
}
358-
}
359-
}
360-
361348
onMount(async () => {
362349
// Hide loading screen
363350
const loadingScreen = document.getElementById('loading-screen')
@@ -617,8 +604,7 @@
617604

618605
<div class="page-container">
619606
{#if isMacOS()}
620-
<!-- svelte-ignore a11y_no_static_element_interactions -->
621-
<header class="title-bar" class:dev-mode={import.meta.env.DEV} onmousedown={handleTitleBarMouseDown}>
607+
<header class="title-bar" class:dev-mode={import.meta.env.DEV} data-tauri-drag-region>
622608
<span class="title-text">{import.meta.env.DEV ? `DEV MODE - ${windowTitle} - DEV MODE` : windowTitle}</span>
623609
</header>
624610
{/if}

0 commit comments

Comments
 (0)