From e403a423b71e5073e1cf215b86b7e348f782d4b5 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Thu, 20 Sep 2018 13:02:07 +0200 Subject: [PATCH] window management fixes (fixes #426) --- app/lib/index.ts | 4 ++++ terminus-core/src/components/windowControls.component.pug | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/lib/index.ts b/app/lib/index.ts index 2e7037c1..a4059caa 100644 --- a/app/lib/index.ts +++ b/app/lib/index.ts @@ -26,6 +26,10 @@ app.on('activate', () => { } }) +app.on('window-all-closed', () => { + app.quit() +}) + process.on('uncaughtException' as any, err => { console.log(err) application.broadcast('uncaughtException', err) diff --git a/terminus-core/src/components/windowControls.component.pug b/terminus-core/src/components/windowControls.component.pug index ad649930..005691d8 100644 --- a/terminus-core/src/components/windowControls.component.pug +++ b/terminus-core/src/components/windowControls.component.pug @@ -9,7 +9,7 @@ button.btn.btn-secondary.btn-maximize( svg(version='1.1', width='10', height='10') path(d='M 0,0 0,10 10,10 10,0 Z M 1,1 9,1 9,9 1,9 Z') button.btn.btn-secondary.btn-close( - (click)='hostApp.quit()', + (click)='hostApp.getWindow().close()', ) svg(version='1.1', width='10', height='10') path(d='M 0,0 0,0.7 4.3,5 0,9.3 0,10 0.7,10 5,5.7 9.3,10 10,10 10,9.3 5.7,5 10,0.7 10,0 9.3,0 5,4.3 0.7,0 Z')