Fix #176: close window on OSX
This commit is contained in:
@@ -66,10 +66,10 @@ function setBounds (bounds, maximize) {
|
||||
// Maximize or minimize, if the second argument is present
|
||||
var willBeMaximized
|
||||
if (maximize === true) {
|
||||
if (!windows.main.isMaximized) windows.main.maximize()
|
||||
if (!windows.main.isMaximized()) windows.main.maximize()
|
||||
willBeMaximized = true
|
||||
} else if (maximize === false) {
|
||||
if (windows.main.isMaximized) windows.main.unmaximize()
|
||||
if (windows.main.isMaximized()) windows.main.unmaximize()
|
||||
willBeMaximized = false
|
||||
} else {
|
||||
willBeMaximized = windows.main.isMaximized()
|
||||
|
||||
@@ -6,7 +6,6 @@ var windows = module.exports = {
|
||||
var electron = require('electron')
|
||||
|
||||
var app = electron.app
|
||||
var ipcMain = electron.ipcMain
|
||||
|
||||
var config = require('../config')
|
||||
var menu = require('./menu')
|
||||
@@ -44,14 +43,8 @@ function createMainWindow () {
|
||||
win.on('close', function (e) {
|
||||
if (process.platform === 'darwin' && !app.isQuitting) {
|
||||
e.preventDefault()
|
||||
// When the window is hidden, the update() loop (which uses
|
||||
// requestAnimationFrame) ceases to run. We need to make sure
|
||||
// the video pauses before hiding or it will continue to play.
|
||||
|
||||
win.send('dispatch', 'pause')
|
||||
ipcMain.once('paused-video', function (e) {
|
||||
win.hide()
|
||||
})
|
||||
win.hide()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user