mirror of
https://github.com/electron/electron.git
synced 2026-01-28 08:48:14 -05:00
win: Correctly close popup menu
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user