diff --git a/apps/desktop/src/components/ui/dialog/DialogOverlay.vue b/apps/desktop/src/components/ui/dialog/DialogOverlay.vue index 4b001dd03f..7d36f1c18b 100644 --- a/apps/desktop/src/components/ui/dialog/DialogOverlay.vue +++ b/apps/desktop/src/components/ui/dialog/DialogOverlay.vue @@ -4,14 +4,30 @@ import type { HTMLAttributes } from "vue"; import { reactiveOmit } from "@vueuse/core"; import { DialogOverlay } from "reka-ui"; import { cn } from "@/lib/utils"; +import { isTauriRuntime } from "@/lib/tauriRuntime"; const props = defineProps(); const delegatedProps = reactiveOmit(props, "class"); +const isDesktop = isTauriRuntime(); + +async function startWindowDrag(event: PointerEvent) { + if (!isDesktop || event.button !== 0) return; + event.preventDefault(); + event.stopPropagation(); + const { getCurrentWindow } = await import("@tauri-apps/api/window"); + const currentWindow = getCurrentWindow(); + if (event.detail >= 2) { + await currentWindow.toggleMaximize().catch(() => {}); + return; + } + await currentWindow.startDragging().catch(() => {}); +}