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
--- 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.