diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index 6ff73b64c..9c19a1c67 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -55,6 +55,7 @@ import { toastQueueAtom } from '../../state/toast'; import { useReminders } from '../../hooks/useReminders'; import { getRoomRetentionMs, isExpired } from '../../utils/retention'; import { useTauriUpdater } from '../../hooks/useTauriUpdater'; +import { invokeTauri } from '../../hooks/useTauri'; import { TauriDesktopFeatures } from '../../components/TauriDesktopFeatures'; import { KeyboardShortcutsDialog, useKeyboardShortcutsTrigger } from '../../features/shortcuts'; import { useRoomsListener } from '../../hooks/useRoomsListener'; @@ -485,6 +486,10 @@ function MessageNotifications() { const onMessage = (event: MessageEvent) => { const data = event.data ?? {}; if (data.type === 'notificationClick' && typeof data.path === 'string') { + // On desktop, raise the native window — a service-worker/WebView2 + // `client.focus()` only focuses the document, not the OS window. No-op + // outside Tauri. + invokeTauri('focus_main_window'); navigate(data.path); } };