Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1543,13 +1543,13 @@ class ApplicationController {
} else if (this.isReady) {
// When app is activated, ensure windows appear on current desktop
const mainWindow = windowManager.getWindow("main");
if (mainWindow && mainWindow.isVisible()) {
if (mainWindow && !mainWindow.isDestroyed() && mainWindow.isVisible()) {
windowManager.showOnCurrentDesktop(mainWindow);
}

// Also handle other visible windows
windowManager.windows.forEach((window, type) => {
if (window.isVisible()) {
if (!window.isDestroyed() && window.isVisible()) {
windowManager.showOnCurrentDesktop(window);
}
});
Expand Down
10 changes: 10 additions & 0 deletions src/managers/window.manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,16 @@ class WindowManager {
onboardingWindow = await this.createWindow('onboarding');
this.windows.set('onboarding', onboardingWindow);

// The 'closed' handlers in setupWindowEventHandlers() are wired once,
// at startup, over the windows that exist then. The onboarding wizard
// is created later, so it needs its own handler — otherwise its entry
// outlives the BrowserWindow and later iterations over this.windows
// call methods on a destroyed object.
onboardingWindow.on('closed', () => {
logger.debug('Window closed', { type: 'onboarding' });
this.windows.delete('onboarding');
});

// Once the wizard renderer signals it's ready, send it the
// current first-run status so it can pre-populate correctly.
onboardingWindow.webContents.once('did-finish-load', () => {
Expand Down