win32ss/user/ntuser/winpos.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/win32ss/user/ntuser/winpos.c b/win32ss/user/ntuser/winpos.c index d7f5ad6a63..48ba8d81eb 100644 --- a/win32ss/user/ntuser/winpos.c +++ b/win32ss/user/ntuser/winpos.c @@ -2002,24 +2002,27 @@ co_WinPosSetWindowPos( if ( !(pwnd->style & WS_CHILD) ) { - HDC hdc; - HRGN DcRgn = NtGdiCreateRectRgn(0, 0, 0, 0); - PREGION DcRgnObj = REGION_LockRgn(DcRgn); + PREGION ClientRgn; - TRACE("SWP_FRAMECHANGED Draw\n"); - - IntGdiCombineRgn(DcRgnObj, VisBefore, NULL, RGN_COPY); - REGION_UnlockRgn(DcRgnObj); + TRACE("SWP_FRAMECHANGED Draw\n"); + /* Create client region and then offset it. */ + ClientRgn = IntSysCreateRectpRgn(Window->rcClient.left, Window->rcClient.top, Window->rcClient.right, Window->rcClient.bottom); + if (ClientRgn) + { + REGION_bOffsetRgn(ClientRgn, -Window->rcWindow.left, -Window->rcWindow.top); - hdc = UserGetDCEx( pwnd, - DcRgn, - DCX_WINDOW|DCX_CACHE|DCX_INTERSECTRGN|DCX_CLIPSIBLINGS|DCX_KEEPCLIPRGN); // DCX_WINDOW, see note above.... + /* Now, remove the client region from the window leaving only the frame. */ + IntGdiCombineRgn(VisAfter, VisAfter, ClientRgn, RGN_XOR); - NC_DoNCPaint(pwnd, hdc, -1); // Force full redraw of nonclient area. + /* Kill copy region. */ + if (CopyRgn) + { + REGION_Delete(CopyRgn); + CopyRgn = NULL; + } - UserReleaseDC(pwnd, hdc, FALSE); - IntValidateParent(pwnd, DcRgnObj); - GreDeleteObject(DcRgn); + REGION_Delete(ClientRgn); + } } }