From 8325bc3f55ca50e7bf09e3384582a7a298b1b4cf Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Wed, 26 Oct 2016 16:51:30 -0400 Subject: [PATCH] Bug 1313195 - Clear active EventStateManager if a XUL popup is opened. r=enndeakin+6102 MozReview-Commit-ID: 2f6ui1X6cxj --HG-- extra : rebase_source : 1dbe37ca5e75c6d1156438a3dc22d38102f5a902 --- layout/xul/nsMenuPopupFrame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 5437d659bd58..6e706e49c228 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -880,6 +880,13 @@ nsMenuPopupFrame::ShowPopup(bool aIsContextMenu) // Clear mouse capture when a popup is opened. if (mPopupType == ePopupTypeMenu) { + EventStateManager* activeESM = + static_cast( + EventStateManager::GetActiveEventStateManager()); + if (activeESM) { + EventStateManager::ClearGlobalActiveContent(activeESM); + } + nsIPresShell::SetCapturingContent(nullptr, 0); }