From a62154253ea2a64e6de8a60958bc1c8fff51f721 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 11 Sep 2013 17:08:53 +1200 Subject: [PATCH] Bug 907926 - Use the ClientArea when initializing the draw target in nsWindowGfx. r=Bas --- widget/windows/nsWindowGfx.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp index b8165b4346fc..f55e48b461dd 100644 --- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -367,10 +367,12 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) nsRefPtr thebesContext; if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(mozilla::gfx::BACKEND_CAIRO)) { + RECT paintRect; + ::GetClientRect(mWnd, &paintRect); RefPtr dt = gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(targetSurface, - mozilla::gfx::IntSize(targetSurface->GetSize().width, - targetSurface->GetSize().height)); + mozilla::gfx::IntSize(paintRect.right - paintRect.left, + paintRect.bottom - paintRect.top)); thebesContext = new gfxContext(dt); } else { thebesContext = new gfxContext(targetSurface);