feat(desktop): support multiple windows

Closes #250
This commit is contained in:
Arielle Ostankova
2026-06-05 21:08:24 +08:00
committed by GitHub
parent 1377adbece
commit df635b570a
12 changed files with 362 additions and 62 deletions
+11 -9
View File
@@ -240,17 +240,19 @@ export function registerWindowManager(): void {
}
export function setupWindowResizeEvents(win: BrowserWindow): void {
win.on("resize", () => {
// A resize/fullscreen event can fire while the window is tearing down; sending
// to a destroyed webContents throws. Guard so multi-window close doesn't surface
// "Object has been destroyed" exceptions.
const notifyResized = () => {
if (win.isDestroyed() || win.webContents.isDestroyed()) {
return;
}
win.webContents.send("paseo:window:resized", {});
});
};
win.on("enter-full-screen", () => {
win.webContents.send("paseo:window:resized", {});
});
win.on("leave-full-screen", () => {
win.webContents.send("paseo:window:resized", {});
});
win.on("resize", notifyResized);
win.on("enter-full-screen", notifyResized);
win.on("leave-full-screen", notifyResized);
}
/**