Bug 1301708 - nsWindow::DealWithPopup() should do nothing at receiving WM_ACTIVATE for a popup window and its wParam includes WA_CLICKACTIVATE. r=masayuki draft
authorStone Shih <sshih@mozilla.com>
Thu, 10 Nov 2016 16:09:25 +0800
changeset 442762 371de468252e7716e2ffe30520939650f76a4222
parent 440252 13f49da109ea460665ad27c8497cb1489548450c
child 537879 3a7624c337273b88ae362859c170f61e2def11d4
push id36801
push usersshih@mozilla.com
push dateWed, 23 Nov 2016 05:10:12 +0000
reviewersmasayuki
bugs1301708
milestone53.0a1
Bug 1301708 - nsWindow::DealWithPopup() should do nothing at receiving WM_ACTIVATE for a popup window and its wParam includes WA_CLICKACTIVATE. r=masayuki When the first time user clicks download panel popup to hide the drop marker popup, Windows fires WA_ACTIVATE with wParam includes WA_CLICKACTIVATE to the download panel. In that case the popupWindow is the drop marker. We shouldn't roll up popups by handling WA_ACTIVATE since we'll handle the rollup behavior with WM_LBUTTONDOWN message. MozReview-Commit-ID: 43jCgdBjjUN
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -7567,17 +7567,18 @@ nsWindow::DealWithPopups(HWND aWnd, UINT
           nsWindow* deactiveWindow = WinUtils::GetNSWindowPtr(aWnd);
           if (deactiveWindow && deactiveWindow->IsPopup()) {
             return false;
           }
         }
       } else if (LOWORD(aWParam) == WA_CLICKACTIVE) {
         // If the WM_ACTIVATE message is caused by a click in a popup,
         // we should not rollup any popups.
-        if (EventIsInsideWindow(popupWindow) ||
+        nsWindow* window = WinUtils::GetNSWindowPtr(aWnd);
+        if ((window && window->IsPopup()) ||
             !GetPopupsToRollup(rollupListener, &popupsToRollup)) {
           return false;
         }
       }
       break;
 
     case MOZ_WM_REACTIVATE:
       // The previous active window should take back focus.