Bug 1186384 - Consider device pixel scale on fullscreen transition window. r=jimm

This commit is contained in:
Xidorn Quan 2015-07-22 23:02:22 +10:00
parent 5b5cf0acd0
commit 1143947892

View File

@ -2994,8 +2994,16 @@ nsWindow::PrepareForFullscreenTransition(nsISupports** aData)
{
FullscreenTransitionInitData initData;
nsCOMPtr<nsIScreen> screen = GetWidgetScreen();
screen->GetRectDisplayPix(&initData.mBounds.x, &initData.mBounds.y,
&initData.mBounds.width, &initData.mBounds.height);
int32_t x, y, width, height;
screen->GetRectDisplayPix(&x, &y, &width, &height);
MOZ_ASSERT(BoundsUseDisplayPixels(),
"Should only be called on top-level window");
CSSToLayoutDeviceScale scale = GetDefaultScale();
initData.mBounds.x = NSToIntRound(x * scale.scale);
initData.mBounds.y = NSToIntRound(y * scale.scale);
initData.mBounds.width = NSToIntRound(width * scale.scale);
initData.mBounds.height = NSToIntRound(height * scale.scale);
// Create a semaphore for synchronizing the window handle which will
// be created by the transition thread and used by the main thread for
// posting the transition messages.