Bug 1321712 - Clicking outside of the download panel should dismiss the panel and sub-menu. r?masayuki
MozReview-Commit-ID: GgMvdCLaeuE
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -7408,17 +7408,18 @@ nsWindow::EventIsInsideWindow(nsWindow*
// static
bool
nsWindow::GetPopupsToRollup(nsIRollupListener* aRollupListener,
uint32_t* aPopupsToRollup)
{
// If we're dealing with menus, we probably have submenus and we don't want
// to rollup some of them if the click is in a parent menu of the current
// submenu.
- *aPopupsToRollup = UINT32_MAX;
+ // Rollup any popups if the event is outside of menus and submenus.
+ *aPopupsToRollup = 0;
AutoTArray<nsIWidget*, 5> widgetChain;
uint32_t sameTypeCount =
aRollupListener->GetSubmenuWidgetChain(&widgetChain);
for (uint32_t i = 0; i < widgetChain.Length(); ++i) {
nsIWidget* widget = widgetChain[i];
if (EventIsInsideWindow(static_cast<nsWindow*>(widget))) {
// Don't roll up if the mouse event occurred within a menu of the
// same type. If the mouse event occurred in a menu higher than that,