mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
fix: only call popup closecallback for top-level menu (#49017)
This commit is contained in:
@@ -563,7 +563,14 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
|
||||
}
|
||||
|
||||
- (void)menuDidClose:(NSMenu*)menu {
|
||||
if (isMenuOpen_) {
|
||||
// If the menu is already closed, do nothing.
|
||||
if (!isMenuOpen_)
|
||||
return;
|
||||
|
||||
// We should only respond to the top-level menu's close event.
|
||||
if (menu != menu_)
|
||||
return;
|
||||
|
||||
isMenuOpen_ = NO;
|
||||
if (model_)
|
||||
model_->MenuWillClose();
|
||||
@@ -573,7 +580,6 @@ NSArray* ConvertSharingItemToNS(const SharingItem& item) {
|
||||
content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
|
||||
std::move(closeCallback));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NSSharingServiceDelegate
|
||||
|
||||
Reference in New Issue
Block a user