Bug 1809054 - Cleanup rect usage in FullscreenTransitionInitData. r=rkraesig

Wrote this while digging into bug 1806438.

Differential Revision: https://phabricator.services.mozilla.com/D166252
This commit is contained in:
Emilio Cobos Álvarez 2023-01-09 16:23:04 +00:00
Родитель 12a39b4292
Коммит dc2ca64ca9
1 изменённых файлов: 4 добавлений и 7 удалений

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

@ -3514,7 +3514,7 @@ static LRESULT CALLBACK FullscreenTransitionWindowProc(HWND hWnd, UINT uMsg,
} }
struct FullscreenTransitionInitData { struct FullscreenTransitionInitData {
nsIntRect mBounds; LayoutDeviceIntRect mBounds;
HANDLE mSemaphore; HANDLE mSemaphore;
HANDLE mThread; HANDLE mThread;
HWND mWnd; HWND mWnd;
@ -3613,14 +3613,11 @@ bool nsWindow::PrepareForFullscreenTransition(nsISupports** aData) {
FullscreenTransitionInitData initData; FullscreenTransitionInitData initData;
nsCOMPtr<nsIScreen> screen = GetWidgetScreen(); nsCOMPtr<nsIScreen> screen = GetWidgetScreen();
int32_t x, y, width, height; const DesktopIntRect rect = screen->GetRectDisplayPix();
screen->GetRectDisplayPix(&x, &y, &width, &height);
MOZ_ASSERT(BoundsUseDesktopPixels(), MOZ_ASSERT(BoundsUseDesktopPixels(),
"Should only be called on top-level window"); "Should only be called on top-level window");
double scale = GetDesktopToDeviceScale().scale; // XXX or GetDefaultScale() ? initData.mBounds =
initData.mBounds.SetRect(NSToIntRound(x * scale), NSToIntRound(y * scale), LayoutDeviceIntRect::Round(rect * GetDesktopToDeviceScale());
NSToIntRound(width * scale),
NSToIntRound(height * scale));
// Create a semaphore for synchronizing the window handle which will // Create a semaphore for synchronizing the window handle which will
// be created by the transition thread and used by the main thread for // be created by the transition thread and used by the main thread for