feat(workspace): when the sleep window is opened, the active window event is not triggered

This commit is contained in:
liujuping 2023-08-02 10:51:55 +08:00 committed by 林熠
parent 15f5675ddd
commit cf3d7a8642

View File

@ -266,10 +266,12 @@ export class Workspace implements IWorkspace {
}); });
this.windows = [...this.windows, window]; this.windows = [...this.windows, window];
this.editorWindowMap.set(window.id, window); this.editorWindowMap.set(window.id, window);
if (!sleep) { if (sleep) {
this.emitChangeWindow();
return;
}
this.window = window; this.window = window;
await this.window.init(); await this.window.init();
}
this.emitChangeWindow(); this.emitChangeWindow();
this.emitChangeActiveWindow(); this.emitChangeActiveWindow();
this.window?.updateState(WINDOW_STATE.active); this.window?.updateState(WINDOW_STATE.active);