Skip to content

Commit

Permalink
Merge pull request #749 from YuRiJinX/develop
Browse files Browse the repository at this point in the history
feat(window): window close logic
  • Loading branch information
ipy authored Jul 16, 2019
2 parents 37e986d + 9e7f631 commit 11dff42
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,9 @@ app.on('ready', () => {
});

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
// if (process.platform !== 'darwin') {
// }
app.quit();
});

app.on('activate', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/containers/LandingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,15 @@ export default {
}
});
window.addEventListener('keyup', this.keyboardHandler);
window.addEventListener('beforeunload', this.beforeUnloadHandler);
// window.addEventListener('beforeunload', this.beforeUnloadHandler);
this.$electron.ipcRenderer.on('quit', () => {
this.quit = true;
});
},
destroyed() {
window.removeEventListener('mousemove', this.globalMoveHandler);
window.removeEventListener('keyup', this.keyboardHandler);
window.removeEventListener('beforeunload', this.beforeUnloadHandler);
// window.removeEventListener('beforeunload', this.beforeUnloadHandler);
},
methods: {
globalMoveHandler() {
Expand Down
18 changes: 9 additions & 9 deletions src/renderer/containers/VideoCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,15 @@ export default {
});
} else if (process.env.NODE_ENV === 'development') { // app.hide() will disable app refresh and not good for dev
} else if (process.platform === 'darwin' && !this.quit) {
e.returnValue = false;
this.$electron.remote.app.hide();
this.$electron.ipcRenderer.send('simulate-closing-window');
this.$bus.$off(); // remove all listeners before back to landing view
// need to init Vuex States
this.$router.push({
name: 'landing-view',
});
windowRectService.uploadWindowBy(false, 'landing-view');
// e.returnValue = false;
// this.$electron.remote.app.hide();
// this.$electron.ipcRenderer.send('simulate-closing-window');
// this.$bus.$off(); // remove all listeners before back to landing view
// // need to init Vuex States
// this.$router.push({
// name: 'landing-view',
// });
// windowRectService.uploadWindowBy(false, 'landing-view');
} else {
this.$electron.remote.app.quit();
}
Expand Down

0 comments on commit 11dff42

Please sign in to comment.