mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1075670 - Make tooltips respect HiDPI displays. r=smaug
Tooltip math was not HiDPI-ready. Bug is exposed by this patch.
This commit is contained in:
parent
45d0ae04d9
commit
dac41d80c0
@ -1453,9 +1453,15 @@ ChromeTooltipListener::sTooltipCallback(nsITimer *aTimer,
|
||||
if (textFound) {
|
||||
nsString tipText(tooltipText);
|
||||
LayoutDeviceIntPoint screenDot = widget->WidgetToScreenOffset();
|
||||
self->ShowTooltip(self->mMouseScreenX - screenDot.x,
|
||||
self->mMouseScreenY - screenDot.y,
|
||||
tipText);
|
||||
double scaleFactor = 1.0;
|
||||
if (shell->GetPresContext()) {
|
||||
scaleFactor = double(nsPresContext::AppUnitsPerCSSPixel())/
|
||||
shell->GetPresContext()->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom();
|
||||
}
|
||||
// ShowTooltip expects widget-relative position.
|
||||
self->ShowTooltip(self->mMouseScreenX - screenDot.x / scaleFactor,
|
||||
self->mMouseScreenY - screenDot.y / scaleFactor,
|
||||
tipText);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user