Bug 1154125 - Ensure the context has up-to-date device pixel DPI scaling before using it in calling nsViewManager::SetWindowDimensions. r=mstange

--HG--
extra : rebase_source : c757bbeae9b86e139b32c224c6df01318cc7a33f
This commit is contained in:
Jonathan Kew 2016-06-30 12:27:29 +01:00
Родитель c694d1761b
Коммит 5848b8fce9
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -1919,6 +1919,14 @@ nsDocumentViewer::SetBoundsWithFlags(const nsIntRect& aBounds, uint32_t aFlags)
aBounds.width, aBounds.height, aBounds.width, aBounds.height,
false); false);
} else if (mPresContext && mViewManager) { } else if (mPresContext && mViewManager) {
// Ensure presContext's deviceContext is up to date, as we sometimes get
// here before a resolution-change notification has been fully handled
// during display configuration changes, especially when there are lots
// of windows/widgets competing to handle the notifications.
// (See bug 1154125.)
if (mPresContext->DeviceContext()->CheckDPIChange()) {
mPresContext->UIResolutionChanged();
}
int32_t p2a = mPresContext->AppUnitsPerDevPixel(); int32_t p2a = mPresContext->AppUnitsPerDevPixel();
mViewManager->SetWindowDimensions(NSIntPixelsToAppUnits(mBounds.width, p2a), mViewManager->SetWindowDimensions(NSIntPixelsToAppUnits(mBounds.width, p2a),
NSIntPixelsToAppUnits(mBounds.height, p2a), NSIntPixelsToAppUnits(mBounds.height, p2a),