move fg/active checks to window focus() instead of tab focus (#1248)

This commit is contained in:
Mike Sawka 2024-11-08 12:42:35 -08:00 committed by GitHub
parent 7718aebc17
commit 8685ca9069
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,13 +7,7 @@ import { debounce } from "throttle-debounce";
import { ClientService, FileService, ObjectService, WindowService } from "../frontend/app/store/services"; import { ClientService, FileService, ObjectService, WindowService } from "../frontend/app/store/services";
import * as keyutil from "../frontend/util/keyutil"; import * as keyutil from "../frontend/util/keyutil";
import { configureAuthKeyRequestInjection } from "./authkey"; import { configureAuthKeyRequestInjection } from "./authkey";
import { import { getGlobalIsQuitting, getGlobalIsRelaunching, setWasActive, setWasInFg } from "./emain-activity";
getGlobalIsQuitting,
getGlobalIsRelaunching,
getGlobalIsStarting,
setWasActive,
setWasInFg,
} from "./emain-activity";
import { import {
delay, delay,
ensureBoundsAreVisible, ensureBoundsAreVisible,
@ -328,13 +322,6 @@ function getOrCreateWebViewForTab(fullConfig: FullConfigType, windowId: string,
console.log("window-open denied", url); console.log("window-open denied", url);
return { action: "deny" }; return { action: "deny" };
}); });
tabView.webContents.on("focus", () => {
setWasInFg(true);
setWasActive(true);
if (getGlobalIsStarting()) {
return;
}
});
tabView.webContents.on("blur", () => { tabView.webContents.on("blur", () => {
handleCtrlShiftFocus(tabView.webContents, false); handleCtrlShiftFocus(tabView.webContents, false);
}); });
@ -490,6 +477,8 @@ function createBaseWaveBrowserWindow(
focusedWaveWindow = win; focusedWaveWindow = win;
console.log("focus win", win.waveWindowId); console.log("focus win", win.waveWindowId);
ClientService.FocusWindow(win.waveWindowId); ClientService.FocusWindow(win.waveWindowId);
setWasInFg(true);
setWasActive(true);
}); });
win.on("blur", () => { win.on("blur", () => {
if (focusedWaveWindow == win) { if (focusedWaveWindow == win) {