Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions js/defaultKeybindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ const defaultKeybindings = {
modalMode.onDismiss = null
}

// enter full screen mode
keybindings.defineShortcut('toggleFullscreen', function () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? I wouldn't expect this to work, since there's no toggleFullscreen defined in defaultKeyMap.

ipc.invoke('setFullScreen', true)
})

// exit full screen mode
webviews.callAsync(tabs.getSelected(), 'executeJavaScript', 'if(document.webkitIsFullScreen){document.webkitExitFullscreen()}')

Expand Down
18 changes: 11 additions & 7 deletions main/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,17 @@ function buildAppMenu (options = {}) {
}
}
},
{
label: l('appMenuFullScreen'),
accelerator: (function () {
if (process.platform == 'darwin') { return 'Ctrl+Command+F' } else { return 'F11' }
})(),
role: 'togglefullscreen'
}
{
label: l('appMenuFullScreen'),
accelerator: (function () {
if (process.platform == 'darwin') { return 'Ctrl+Command+F' } else { return 'F11' }
})(),
click: function (item, focusedWindow) {
if (focusedWindow) {
focusedWindow.setFullScreen(!focusedWindow.isFullScreen())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this produce a different result than role: 'togglefullscreen'? If it does, that's probably a bug in Electron - would you be willing to make a reduced testcase of this and open an issue there?

}
}
}
]
},
{
Expand Down