diff --git a/reactos/subsys/win32k/include/dce.h b/reactos/subsys/win32k/include/dce.h index 9fd0f4efd22..cc79ce64427 100644 --- a/reactos/subsys/win32k/include/dce.h +++ b/reactos/subsys/win32k/include/dce.h @@ -53,6 +53,6 @@ HWND FASTCALL IntWindowFromDC(HDC hDc); PDCE FASTCALL DceFreeDCE(PDCE dce, BOOLEAN Force); void FASTCALL DceFreeWindowDCE(PWINDOW_OBJECT Window); void FASTCALL DceEmptyCache(void); -VOID FASTCALL DceResetActiveDCEs(PWINDOW_OBJECT Window, int DeltaX, int DeltaY); +VOID FASTCALL DceResetActiveDCEs(PWINDOW_OBJECT Window); #endif /* _WIN32K_DCE_H */ diff --git a/reactos/subsys/win32k/ntuser/windc.c b/reactos/subsys/win32k/ntuser/windc.c index bff62569972..1990fb38249 100644 --- a/reactos/subsys/win32k/ntuser/windc.c +++ b/reactos/subsys/win32k/ntuser/windc.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: windc.c,v 1.70 2004/12/17 19:42:46 navaraf Exp $ +/* $Id: windc.c,v 1.71 2004/12/26 20:34:49 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -770,11 +770,13 @@ DceEmptyCache() } VOID FASTCALL -DceResetActiveDCEs(PWINDOW_OBJECT Window, int DeltaX, int DeltaY) +DceResetActiveDCEs(PWINDOW_OBJECT Window) { DCE *pDCE; PDC dc; PWINDOW_OBJECT CurrentWindow; + INT DeltaX; + INT DeltaY; if (NULL == Window) { @@ -801,16 +803,10 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window, int DeltaX, int DeltaY) continue; } } - if (!GDIOBJ_OwnedByCurrentProcess(pDCE->hDC)) - { - /* skip DCs we don't even own */ - goto skip; - } dc = DC_LockDc(pDCE->hDC); if (dc == NULL) { -skip: if (Window->Self != pDCE->hwndCurrent) { IntReleaseWindowObject(CurrentWindow); @@ -818,11 +814,22 @@ skip: pDCE = pDCE->next; continue; } - if ((0 != DeltaX || 0 != DeltaY) - && (Window == CurrentWindow || IntIsChildWindow(Window->Self, CurrentWindow->Self))) + if (Window == CurrentWindow || IntIsChildWindow(Window->Self, CurrentWindow->Self)) { - dc->w.DCOrgX += DeltaX; - dc->w.DCOrgY += DeltaY; + if (pDCE->DCXFlags & DCX_WINDOW) + { + DeltaX = CurrentWindow->WindowRect.left - dc->w.DCOrgX; + DeltaY = CurrentWindow->WindowRect.top - dc->w.DCOrgY; + dc->w.DCOrgX = CurrentWindow->WindowRect.left; + dc->w.DCOrgY = CurrentWindow->WindowRect.top; + } + else + { + DeltaX = CurrentWindow->ClientRect.left - dc->w.DCOrgX; + DeltaY = CurrentWindow->ClientRect.top - dc->w.DCOrgY; + dc->w.DCOrgX = CurrentWindow->ClientRect.left; + dc->w.DCOrgY = CurrentWindow->ClientRect.top; + } if (NULL != dc->w.hClipRgn) { NtGdiOffsetRgn(dc->w.hClipRgn, DeltaX, DeltaY); diff --git a/reactos/subsys/win32k/ntuser/winpos.c b/reactos/subsys/win32k/ntuser/winpos.c index 5f361247ec0..615542ca64e 100644 --- a/reactos/subsys/win32k/ntuser/winpos.c +++ b/reactos/subsys/win32k/ntuser/winpos.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: winpos.c,v 1.127 2004/12/12 23:08:12 navaraf Exp $ +/* $Id: winpos.c,v 1.128 2004/12/26 20:34:49 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -977,9 +977,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, Window->Style |= WS_VISIBLE; } - DceResetActiveDCEs(Window, - NewWindowRect.left - OldWindowRect.left, - NewWindowRect.top - OldWindowRect.top); + DceResetActiveDCEs(Window); if (!(WinPos.flags & SWP_NOREDRAW)) {