mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
multiple windows
This commit is contained in:
parent
98b18ea2b5
commit
a6480206cd
3 changed files with 43 additions and 36 deletions
34
electron.js
34
electron.js
|
@ -107,7 +107,7 @@ nativeTheme.on('updated', () => {
|
|||
});
|
||||
|
||||
function createMainWindow () {
|
||||
mainWindow = WindowManager.createMain({ withState: true });
|
||||
mainWindow = WindowManager.createMain({ withState: true, route: Util.getRouteFromUrl(deeplinkingUrl) });
|
||||
|
||||
mainWindow.once('ready-to-show', () => {
|
||||
mainWindow.show();
|
||||
|
@ -123,6 +123,27 @@ function createMainWindow () {
|
|||
);
|
||||
};
|
||||
|
||||
mainWindow.on('close', (e) => {
|
||||
Util.log('info', 'closeMain: ' + app.isQuiting);
|
||||
|
||||
if (app.isQuiting) {
|
||||
return;
|
||||
};
|
||||
|
||||
e.preventDefault();
|
||||
if (!is.linux) {
|
||||
if (win.isFullScreen()) {
|
||||
win.setFullScreen(false);
|
||||
win.once('leave-full-screen', () => { win.hide(); });
|
||||
} else {
|
||||
win.hide();
|
||||
};
|
||||
} else {
|
||||
this.exit(false);
|
||||
};
|
||||
return false;
|
||||
});
|
||||
|
||||
registerIpcEventsMain();
|
||||
registerIpcEventsWindow();
|
||||
|
||||
|
@ -143,16 +164,7 @@ function createMainWindow () {
|
|||
};
|
||||
|
||||
function createChildWindow (route) {
|
||||
const win = WindowManager.createMain({ withState: false });
|
||||
|
||||
win.once('ready-to-show', () => {
|
||||
win.show();
|
||||
|
||||
if (route) {
|
||||
Util.send(win, 'route', route);
|
||||
};
|
||||
});
|
||||
|
||||
WindowManager.createMain({ withState: false, route: route });
|
||||
registerIpcEventsWindow();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue