Skip to content

Commit

Permalink
restore the window if menu actions are triggered when minimized - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Sep 29, 2015
1 parent eb56a02 commit fb57938
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const shell = require('shell');
const appName = app.getName();

function sendAction(action) {
BrowserWindow.getFocusedWindow().webContents.send(action);
const win = BrowserWindow.getAllWindows()[0];
win.restore();
win.webContents.send(action);
}

const darwinTpl = [
Expand Down Expand Up @@ -151,7 +153,7 @@ const darwinTpl = [
label: 'Toggle Full Screen',
accelerator: 'Ctrl+Cmd+F',
click() {
const win = BrowserWindow.getFocusedWindow();
const win = BrowserWindow.getAllWindows()[0];
win.setFullScreen(!win.isFullScreen());
}
}
Expand Down

0 comments on commit fb57938

Please sign in to comment.