diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index b0a25da81abd..9e0a1118f0fb 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -3346,7 +3346,6 @@ nsBoxFrame::GetCursor(nsIPresContext* aPresContext, char idValue[100]; id.ToCString(idValue,100); */ - nsRect bounds(0,0,mRect.width, mRect.height); /// printf("----------Box id = %s-----------\n", idValue); // printf("x=%d, r.x=%d r.x + r.width=%d\n",newPoint.x, or.x, or.x + or.width); diff --git a/layout/xul/base/src/nsMenuPopupFrame.cpp b/layout/xul/base/src/nsMenuPopupFrame.cpp index 9f527854295d..0931b5d0ea30 100644 --- a/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -263,12 +263,12 @@ nsMenuPopupFrame :: AdjustClientXYForNestedDocuments ( nsIDOMXULDocument* inPopu nsCOMPtr targetDocument; targetAsContent->GetDocument(*getter_AddRefs(targetDocument)); nsCOMPtr shell = targetDocument->GetShellAt(0); - nsCOMPtr viewManager; - shell->GetViewManager(getter_AddRefs(viewManager)); - nsIView* rootView; - viewManager->GetRootView(rootView); - nscoord wOffsetX, wOffsetY; - rootView->GetOffsetFromWidget(&wOffsetX, &wOffsetY, *getter_AddRefs(targetDocumentWidget)); + nsCOMPtr viewManagerTarget; + shell->GetViewManager(getter_AddRefs(viewManagerTarget)); + nsIView* rootViewTarget; + viewManagerTarget->GetRootView(rootViewTarget); + nscoord unusedX, unusedY; + rootViewTarget->GetOffsetFromWidget(&unusedX, &unusedY, *getter_AddRefs(targetDocumentWidget)); } // the offset we need is the difference between the upper left corner of the two widgets. Use @@ -468,6 +468,12 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext, viewManager->MoveViewTo(view, xpos, ypos); viewManager->ResizeView(view, mRect.width, mRect.height); + // just before we show it, make sure it's been reflowed. if not, we get weird + // redraw problems because of async layout + nsCOMPtr myShell; + mPresContext->GetShell(getter_AddRefs(myShell)); + myShell->ProcessReflowCommands ( PR_FALSE ); + nsAutoString shouldDisplay; mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, shouldDisplay); if ( shouldDisplay.Equals("true") )