diff --git a/src/app/features/desktop/TitleBar.tsx b/src/app/features/desktop/TitleBar.tsx index a88f8b687..41f3d379f 100644 --- a/src/app/features/desktop/TitleBar.tsx +++ b/src/app/features/desktop/TitleBar.tsx @@ -66,8 +66,9 @@ function ControlButton({ label, glyph, onClick, close }: ControlButtonProps) { * * Renders `null` unless we're inside Tauri **and** the user opted into custom * window chrome. Otherwise it draws a thin (~32px) folds/TDS-styled titlebar: a - * draggable region (`data-tauri-drag-region`) with the app brand, plus - * minimize / maximize / close controls that call the native window commands. + * draggable region (explicit `window_start_drag` on mousedown, double-press to + * maximize) with the app brand, plus minimize / maximize / close controls that + * call the native window commands. * * OS-aware: Windows/Linux put the controls on the right; macOS mirrors them to * the left (the native traffic-light position) since decorations — and thus the @@ -80,10 +81,18 @@ export function TitleBar() { const mac = isMacOS(); - const handleDoubleClick = (evt: MouseEvent): void => { - // Only the drag surface itself toggles maximize, not the brand/children. - if (evt.target !== evt.currentTarget) return; - invokeTauri('window_toggle_maximize'); + // Official Tauri custom-titlebar recipe: primary-button mousedown starts an + // OS window drag; a double press (detail === 2) toggles maximize instead. An + // explicit `window_start_drag` invoke is used rather than + // `data-tauri-drag-region` because the attribute only fires when the exact + // element is the event target (children like the brand text wouldn't drag). + const handleDragMouseDown = (evt: MouseEvent): void => { + if (evt.button !== 0) return; + if (evt.detail === 2) { + invokeTauri('window_toggle_maximize'); + } else { + invokeTauri('window_start_drag'); + } }; const controls = ( @@ -108,7 +117,7 @@ export function TitleBar() { ); const dragRegion = ( -
+
Lotus Chat