minimize: 'minimize',
close: 'close',
delete: 'delete',
- quit: 'quit'
+ quit: 'quit',
+ togglefullscreen: 'toggleFullScreen'
}
// Maps methods that should be called directly on the BrowserWindow instance
const methodInBrowserWindow = {
minimize: true,
- close: true
+ close: true,
+ toggleFullScreen: function (window) {
+ window.setFullScreen(!window.isFullScreen())
+ }
}
const methodInApp = {
if (methodInApp[methodName]) {
return app[methodName]()
} else if (methodInBrowserWindow[methodName]) {
- return focusedWindow[methodName]()
+ if (typeof methodName === 'function') {
+ return methodName(focusedWindow)
+ } else {
+ return focusedWindow[methodName]()
+ }
} else {
const {webContents} = focusedWindow
return webContents != null ? webContents[methodName]() : void 0