mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1252347 - Provide missing implementations of nsIBaseWindow::SetPositionDesktopPix. r=emk
This commit is contained in:
parent
6ef0c99e05
commit
7505fe3457
@ -5820,10 +5820,14 @@ nsDocShell::SetPosition(int32_t aX, int32_t aY)
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetPositionDesktopPix(int32_t aX, int32_t aY)
|
||||
{
|
||||
// Added to nsIBaseWindow in bug 1247335;
|
||||
// implement if a use-case is found.
|
||||
NS_ASSERTION(false, "implement me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
nsCOMPtr<nsIBaseWindow> ownerWindow(do_QueryInterface(mTreeOwner));
|
||||
if (ownerWindow) {
|
||||
return ownerWindow->SetPositionDesktopPix(aX, aY);
|
||||
}
|
||||
|
||||
double scale = 1.0;
|
||||
GetDevicePixelsPerDesktopPixel(&scale);
|
||||
return SetPosition(NSToIntRound(aX * scale), NSToIntRound(aY * scale));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -573,10 +573,13 @@ nsDocShellTreeOwner::GetDevicePixelsPerDesktopPixel(double* aScale)
|
||||
NS_IMETHODIMP
|
||||
nsDocShellTreeOwner::SetPositionDesktopPix(int32_t aX, int32_t aY)
|
||||
{
|
||||
// Added to nsIBaseWindow in bug 1247335;
|
||||
// implement if a use-case is found.
|
||||
NS_ASSERTION(false, "implement me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
if (mWebBrowser) {
|
||||
return mWebBrowser->SetPositionDesktopPix(aX, aY);
|
||||
}
|
||||
|
||||
double scale = 1.0;
|
||||
GetDevicePixelsPerDesktopPixel(&scale);
|
||||
return SetPosition(NSToIntRound(aX * scale), NSToIntRound(aY * scale));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -1305,10 +1305,16 @@ nsWebBrowser::GetDevicePixelsPerDesktopPixel(double* aScale)
|
||||
NS_IMETHODIMP
|
||||
nsWebBrowser::SetPositionDesktopPix(int32_t aX, int32_t aY)
|
||||
{
|
||||
// Added to nsIBaseWindow in bug 1247335;
|
||||
// implement if a use-case is found.
|
||||
NS_ASSERTION(false, "implement me!");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
// XXX jfkthame
|
||||
// It's not clear to me whether this will be fully correct across
|
||||
// potential multi-screen, mixed-DPI configurations for all platforms;
|
||||
// we might need to add code paths that make it possible to pass the
|
||||
// desktop-pix parameters all the way through to the native widget,
|
||||
// to avoid the risk of device-pixel coords mapping to the wrong
|
||||
// display on OS X with mixed retina/non-retina screens.
|
||||
double scale = 1.0;
|
||||
GetDevicePixelsPerDesktopPixel(&scale);
|
||||
return SetPosition(NSToIntRound(aX * scale), NSToIntRound(aY * scale));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
Loading…
Reference in New Issue
Block a user