🎨
This commit is contained in:
parent
e1459b7db7
commit
72cdba2b8e
2 changed files with 1 additions and 4 deletions
|
@ -118,7 +118,6 @@ Menu.prototype._init = function () {
|
||||||
executeCommand: (event, commandId) => {
|
executeCommand: (event, commandId) => {
|
||||||
const command = this.commandsMap[commandId]
|
const command = this.commandsMap[commandId]
|
||||||
if (command == null) return
|
if (command == null) return
|
||||||
|
|
||||||
command.click(event, BrowserWindow.getFocusedWindow(), webContents.getFocusedWebContents())
|
command.click(event, BrowserWindow.getFocusedWindow(), webContents.getFocusedWebContents())
|
||||||
},
|
},
|
||||||
menuWillShow: () => {
|
menuWillShow: () => {
|
||||||
|
|
|
@ -251,12 +251,10 @@ module.exports = {
|
||||||
let focused = null
|
let focused = null
|
||||||
for (let contents of getAllWebContents()) {
|
for (let contents of getAllWebContents()) {
|
||||||
if (!contents.isFocused()) continue
|
if (!contents.isFocused()) continue
|
||||||
|
if (focused == null) focused = contents
|
||||||
// Return webview web contents which may be embedded inside another
|
// Return webview web contents which may be embedded inside another
|
||||||
// web contents that is also reporting as focused
|
// web contents that is also reporting as focused
|
||||||
if (contents.getType() === 'webview') return contents
|
if (contents.getType() === 'webview') return contents
|
||||||
|
|
||||||
if (focused == null) focused = contents
|
|
||||||
}
|
}
|
||||||
return focused
|
return focused
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue