fix(desktop): preserve user focus during preview presses #9848
Closed0bkevin(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/9848/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/desktop/src/preview/Manager.ts line 3899OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -3882,4 +3883,17 @@38823883 yield* sendCleanup("Emulation.setFocusEmulationEnabled", { enabled: false }).pipe(38833884 Effect.ignore,38843885 );3885- if (previouslyFocused && previouslyFocused.id !== wc.id && !previouslyFocused.isDestroyed()) {3886+ const focusedWebContents = yield* attempt(3887+ {3888+ operation: "automationPress.getCurrentFocusedWebContents",3889+ tabId,3890+ webContentsId: wc.id,3891+ },3892+ () => webContents.getFocusedWebContents(),3893+ ).pipe(Effect.orElseSucceed(() => null));3894+ const focusedWindow = yield* attempt(3895+ { operation: "automationPress.getFocusedWindow", tabId, webContentsId: wc.id },3896+ () => BrowserWindow.getFocusedWindow(),3897+ ).pipe(Effect.orElseSucceed(() => null));3898+ if (3899+ !interruptedByHumanInput &&
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed