зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
8de96f400d
Коммит
32cde57ad0
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче