win: Correctly close popup menu
This commit is contained in:
parent
459db92052
commit
088042841d
3 changed files with 23 additions and 7 deletions
|
@ -94,10 +94,13 @@ Menu.prototype.popup = function (window, x, y, positioningItem) {
|
|||
}
|
||||
|
||||
Menu.prototype.closePopup = function (window) {
|
||||
if (!window || window.constructor !== BrowserWindow) {
|
||||
window = BrowserWindow.getFocusedWindow()
|
||||
if (window && window.constructor !== BrowserWindow) {
|
||||
this.closePopupAt(window.id)
|
||||
} else {
|
||||
// Passing -1 (invalid) would make closePopupAt close the all menu runners
|
||||
// belong to this menu.
|
||||
this.closePopupAt(-1)
|
||||
}
|
||||
if (window) this.closePopupAt(window.id)
|
||||
}
|
||||
|
||||
Menu.prototype.getMenuItemById = function (id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue