Windows update (#49)

This commit is contained in:
2026-04-11 21:45:52 -07:00
committed by GitHub
parent 49e46e6b9b
commit 52bab1d611
168 changed files with 9732 additions and 1422 deletions
+2 -1
View File
@@ -23,7 +23,7 @@ test('createMainBootServices builds boot-phase service bundle', () => {
{ kind: string },
{ scope: string; warn: () => void; info: () => void; error: () => void },
{ registry: boolean },
{ getModalWindow: () => null },
{ getMainWindow: () => null; getModalWindow: () => null },
{
inputState: boolean;
getModalInputExclusive: () => boolean;
@@ -82,6 +82,7 @@ test('createMainBootServices builds boot-phase service bundle', () => {
}) as const,
createMainRuntimeRegistry: () => ({ registry: true }),
createOverlayManager: () => ({
getMainWindow: () => null,
getModalWindow: () => null,
}),
createOverlayModalInputState: () => ({
+22 -1
View File
@@ -74,6 +74,7 @@ export interface MainBootServicesParams<
getModalWindow: () => BrowserWindow | null;
syncOverlayShortcutsForModal: (isActive: boolean) => void;
syncOverlayVisibilityForModal: () => void;
restoreMainWindowFocus?: () => void;
}) => TOverlayModalInputState;
createOverlayContentMeasurementStore: (params: {
logger: TLogger;
@@ -131,7 +132,7 @@ export function createMainBootServices<
TSubtitleWebSocket,
TLogger,
TRuntimeRegistry,
TOverlayManager extends { getModalWindow: () => BrowserWindow | null },
TOverlayManager extends { getMainWindow: () => BrowserWindow | null; getModalWindow: () => BrowserWindow | null },
TOverlayModalInputState extends OverlayModalInputStateShape,
TOverlayContentMeasurementStore,
TOverlayModalRuntime,
@@ -212,6 +213,26 @@ export function createMainBootServices<
syncOverlayVisibilityForModal: () => {
params.getSyncOverlayVisibilityForModal()();
},
restoreMainWindowFocus: () => {
const mainWindow = overlayManager.getMainWindow();
if (!mainWindow || mainWindow.isDestroyed() || !mainWindow.isVisible()) return;
try {
const electron = require('electron') as {
app?: { focus?: (options?: { steal?: boolean }) => void };
};
electron.app?.focus?.({ steal: true });
} catch {
// Ignore in non-Electron environments.
}
const maybeFocusable = mainWindow as typeof mainWindow & {
setFocusable?: (focusable: boolean) => void;
};
maybeFocusable.setFocusable?.(true);
mainWindow.focus();
if (!mainWindow.webContents.isFocused()) {
mainWindow.webContents.focus();
}
},
});
const overlayContentMeasurementStore = params.createOverlayContentMeasurementStore({
logger,