mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-23 13:01:25 -08:00
fix: cmd+w closed window cannot restore
https://github.com/keybase/client/pull/3317/files https://github.com/maxogden/menubar/pull/101
This commit is contained in:
parent
14642e07cf
commit
d4a000c99c
2 changed files with 6 additions and 4 deletions
|
|
@ -102,7 +102,6 @@ export class Window implements IWindowService {
|
|||
await this.setWindowMeta(windowName, meta);
|
||||
const existedWindowMeta = await this.getWindowMeta(windowName);
|
||||
|
||||
// handle existed window, bring existed window to the front and return.
|
||||
if (existedWindow !== undefined) {
|
||||
if (recreate === true || (typeof recreate === 'function' && existedWindowMeta !== undefined && recreate(existedWindowMeta))) {
|
||||
existedWindow.close();
|
||||
|
|
@ -520,7 +519,6 @@ export class Window implements IWindowService {
|
|||
minWidth: 250,
|
||||
}),
|
||||
});
|
||||
menuBar.app.commandLine.appendSwitch('disable-backgrounding-occluded-windows', 'true');
|
||||
|
||||
menuBar.on('after-create-window', () => {
|
||||
if (menuBar.window !== undefined) {
|
||||
|
|
@ -530,6 +528,11 @@ export class Window implements IWindowService {
|
|||
view.webContents.focus();
|
||||
}
|
||||
});
|
||||
menuBar.window.removeAllListeners('close');
|
||||
menuBar.window.on('close', (event) => {
|
||||
event.preventDefault();
|
||||
menuBar.hideWindow();
|
||||
});
|
||||
}
|
||||
});
|
||||
// https://github.com/maxogden/menubar/issues/120
|
||||
|
|
|
|||
|
|
@ -230,13 +230,12 @@ export class WorkspaceView implements IWorkspaceViewService {
|
|||
}
|
||||
|
||||
public async setActiveWorkspaceView(workspaceID: string): Promise<void> {
|
||||
const mainWindow = this.windowService.get(WindowNames.main);
|
||||
const oldActiveWorkspace = await this.workspaceService.getActiveWorkspace();
|
||||
const newWorkspace = await this.workspaceService.get(workspaceID);
|
||||
if (newWorkspace === undefined) {
|
||||
throw new Error(`Workspace id ${workspaceID} does not exist. When setActiveWorkspaceView().`);
|
||||
}
|
||||
if (mainWindow !== undefined && oldActiveWorkspace !== undefined) {
|
||||
if (oldActiveWorkspace !== undefined) {
|
||||
await this.workspaceService.setActiveWorkspace(workspaceID);
|
||||
await this.viewService.setActiveViewForAllBrowserViews(workspaceID);
|
||||
// if we are switching to a new workspace, we hibernate old view, and activate new view
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue