Bug 1321712 - Clicking outside of the download panel should dismiss the panel and sub-menu. r?masayuki draft
authorStone Shih <sshih@mozilla.com>
Tue, 13 Dec 2016 11:29:29 +0800
changeset 448840 51a8c398862fa19fce98c3f42cb47c921bfbcb85
parent 448717 f46f85dcfbc2b3098ea758825d18be6fab33cbc6
child 539389 a893ea3e27cb534994532d296b764a9f75e6b876
push id38449
push usersshih@mozilla.com
push dateTue, 13 Dec 2016 03:33:11 +0000
reviewersmasayuki
bugs1321712
milestone53.0a1
Bug 1321712 - Clicking outside of the download panel should dismiss the panel and sub-menu. r?masayuki MozReview-Commit-ID: GgMvdCLaeuE
widget/windows/nsWindow.cpp
--- 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,