fix: restore desktop window dragging on remote instances

- Fixes header drag behavior in Desktop when connected to remote hosts
- Routes all window-drag entry points through a shared safe desktop helper
- Keeps local desktop drag behavior unchanged while avoiding remote IPC failures
This commit is contained in:
Bohdan Triapitsyn
2026-04-14 19:33:09 +03:00
parent c7f1501ad2
commit 16270e4b03
6 changed files with 26 additions and 41 deletions
@@ -1,6 +1,6 @@
import React from 'react';
import { RiFileCopyLine, RiCheckLine, RiExternalLinkLine } from '@remixicon/react';
import { isDesktopShell, isTauriShell } from '@/lib/desktop';
import { isDesktopShell, isTauriShell, startDesktopWindowDrag } from '@/lib/desktop';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { updateDesktopSettings } from '@/lib/persistence';
@@ -105,14 +105,8 @@ export function OnboardingScreen({ onCliAvailable }: OnboardingScreenProps) {
return;
}
if (e.button !== 0) return;
if (isDesktopApp && isTauriShell()) {
try {
const { getCurrentWindow } = await import('@tauri-apps/api/window');
const window = getCurrentWindow();
await window.startDragging();
} catch (error) {
console.error('Failed to start window dragging:', error);
}
if (isDesktopApp) {
await startDesktopWindowDrag();
}
}, [isDesktopApp]);