Bug 851641. Ignore move/resize notifications for popups whose widget is hidden because this likely means they are notifications about our own move/resize requests. r=mats
authorTimothy Nikkel <tnikkel@gmail.com>
Sun, 28 Apr 2013 15:27:25 -0500
changeset 130195 e116c3a3476406f91bff7b62c26a05e6829a7636
parent 130194 2fbb0094f6f4b69705bb29b2289bcc92ca50459d
child 130196 3b3d66182d26817017b922bb9d22a40f0cf04af2
push idunknown
push userunknown
push dateunknown
reviewersmats
bugs851641
milestone23.0a1
Bug 851641. Ignore move/resize notifications for popups whose widget is hidden because this likely means they are notifications about our own move/resize requests. r=mats
layout/xul/base/src/nsXULPopupManager.cpp
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -336,16 +336,20 @@ nsMenuPopupFrame* GetPopupToMoveOrResize
   nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(aFrame);
   if (!menuPopupFrame)
     return nullptr;
 
   // no point moving or resizing hidden popups
   if (menuPopupFrame->PopupState() != ePopupOpenAndVisible)
     return nullptr;
 
+  nsIWidget* widget = menuPopupFrame->GetWidget();
+  if (widget && !widget->IsVisible())
+    return nullptr;
+
   return menuPopupFrame;
 }
 
 void
 nsXULPopupManager::PopupMoved(nsIFrame* aFrame, nsIntPoint aPnt)
 {
   nsMenuPopupFrame* menuPopupFrame = GetPopupToMoveOrResize(aFrame);
   if (!menuPopupFrame)