all main modules have init() function
This commit is contained in:
@@ -9,12 +9,6 @@ var electron = require('electron')
|
||||
|
||||
var app = electron.app
|
||||
|
||||
var isQuitting = false
|
||||
|
||||
app.on('before-quit', function () {
|
||||
isQuitting = true
|
||||
})
|
||||
|
||||
function createMainWindow (menu) {
|
||||
var win = windows.main = new electron.BrowserWindow({
|
||||
autoHideMenuBar: true, // Hide top menu bar unless Alt key is pressed (Windows, Linux)
|
||||
@@ -46,7 +40,7 @@ function createMainWindow (menu) {
|
||||
win.on('leave-full-screen', () => menu.onToggleFullScreen(false))
|
||||
|
||||
win.on('close', function (e) {
|
||||
if (process.platform === 'darwin' && !isQuitting) {
|
||||
if (process.platform === 'darwin' && !app.isQuitting) {
|
||||
e.preventDefault()
|
||||
// sendSync() ensures that video will pause before window is hidden, at which point
|
||||
// the update() loop (which uses requestAnimationFrame) ceases to run
|
||||
|
||||
Reference in New Issue
Block a user