bug 890374 - [hidpi] fix CSS/device coordinate mismatch in XUL popup manager, so that we show the correct tooltip for items in the Bookmarks or History sidebar. r=roc

This commit is contained in:
Jonathan Kew 2013-07-16 15:12:48 +01:00
Родитель 8de96f400d
Коммит 32cde57ad0
1 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -647,16 +647,17 @@ nsXULPopupManager::ShowTooltipAtScreen(nsIContent* aPopup,
InitTriggerEvent(nullptr, nullptr, nullptr);
mCachedMousePoint = nsIntPoint(aXPos, aYPos);
nsPresContext* pc = popupFrame->PresContext();
mCachedMousePoint = nsIntPoint(pc->CSSPixelsToDevPixels(aXPos),
pc->CSSPixelsToDevPixels(aYPos));
// coordinates are relative to the root widget
nsPresContext* rootPresContext =
popupFrame->PresContext()->GetRootPresContext();
nsPresContext* rootPresContext = pc->GetRootPresContext();
if (rootPresContext) {
nsCOMPtr<nsIWidget> widget;
rootPresContext->PresShell()->GetViewManager()->
GetRootWidget(getter_AddRefs(widget));
if (widget)
mCachedMousePoint -= widget->WidgetToScreenOffset();
nsIWidget *rootWidget = rootPresContext->GetRootWidget();
if (rootWidget) {
mCachedMousePoint -= rootWidget->WidgetToScreenOffset();
}
}
popupFrame->InitializePopupAtScreen(aTriggerContent, aXPos, aYPos, false);