Bug 1301708 - nsWindow::DealWithPopup() should do nothing at receiving WM_ACTIVATE for a popup window and its wParam includes WA_CLICKACTIVATE. r=masayuki
authorStone Shih <sshih@mozilla.com>
Thu, 10 Nov 2016 16:09:25 +0800
changeset 324055 36a118cbe8155070604735f80e81088ce1df7828
parent 324054 120c84ca53629202c22cce565053fee7973eea72
child 324056 809655f44e1988e72f4efb0f7ccb22b64a8f8a4d
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +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
@@ -7569,17 +7569,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.