Bug 992229, convert device to css pixels before setting menupopup position after move or resize, r=tn

This commit is contained in:
Neil Deakin 2014-04-08 08:45:52 -04:00
parent dcfe22cf0c
commit 83460d86bc
2 changed files with 9 additions and 3 deletions

View File

@ -271,6 +271,9 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
(oldRect.x != rect.x || oldRect.y != rect.y) &&
(!menuPopupFrame->IsAnchored() ||
menuPopupFrame->PopupLevel() != ePopupLevelParent)) {
rect.x = aPresContext->DevPixelsToIntCSSPixels(rect.x);
rect.y = aPresContext->DevPixelsToIntCSSPixels(rect.y);
menuPopupFrame->MoveTo(rect.x, rect.y, true);
}
}

View File

@ -127,7 +127,10 @@ nsTitleBarFrame::HandleEvent(nsPresContext* aPresContext,
nsCOMPtr<nsIWidget> widget = menuPopupFrame->GetWidget();
nsIntRect bounds;
widget->GetScreenBounds(bounds);
menuPopupFrame->MoveTo(bounds.x + nsMoveBy.x, bounds.y + nsMoveBy.y, false);
int32_t newx = aPresContext->DevPixelsToIntCSSPixels(bounds.x + nsMoveBy.x);
int32_t newy = aPresContext->DevPixelsToIntCSSPixels(bounds.y + nsMoveBy.y);
menuPopupFrame->MoveTo(newx, newy, false);
}
else {
nsIPresShell* presShell = aPresContext->PresShell();