Second attempt at bug #5: reset active DCEs when window positions change

svn path=/trunk/; revision=8032
This commit is contained in:
Gé van Geldorp 2004-02-04 22:59:04 +00:00
parent 40bc1b6611
commit 969bf0b926
3 changed files with 42 additions and 26 deletions

View file

@ -42,7 +42,6 @@ typedef struct tagDCE
#define DCEOBJ_LockDCE(hDCE) ((PDCE)GDIOBJ_LockObj((HGDIOBJ)hDCE, GDI_OBJECT_TYPE_DCE))
#define DCEOBJ_UnlockDCE(hDCE) GDIOBJ_UnlockObj((HGDIOBJ)hDCE, GDI_OBJECT_TYPE_DCE)
PDCE FASTCALL DCE_AllocDCE(HWND hWnd, DCE_TYPE type); // ???
PDCE FASTCALL DceAllocDCE(HWND hWnd, DCE_TYPE Type);
PDCE FASTCALL DCE_FreeDCE(PDCE dce);
VOID FASTCALL DCE_FreeWindowDCE(HWND);
@ -54,6 +53,6 @@ HWND FASTCALL IntWindowFromDC(HDC hDc);
PDCE FASTCALL DceFreeDCE(PDCE dce);
void FASTCALL DceFreeWindowDCE(PWINDOW_OBJECT Window);
void FASTCALL DceEmptyCache(void);
VOID FASTCALL DceMoveDCE(HWND hwnd, int X, int Y);
VOID FASTCALL DceResetActiveDCEs(PWINDOW_OBJECT Window, int DeltaX, int DeltaY);
#endif /* _WIN32K_DCE_H */

View file

@ -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.53 2004/02/02 23:28:17 gvg Exp $
/* $Id: windc.c,v 1.54 2004/02/04 22:59:04 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -685,11 +685,12 @@ DceEmptyCache()
}
}
VOID FASTCALL DceMoveDCE(HWND hwnd, int X, int Y)
VOID FASTCALL
DceResetActiveDCEs(PWINDOW_OBJECT Window, int DeltaX, int DeltaY)
{
DCE *pDCE;
PWINDOW_OBJECT Window = IntGetWindowObject(hwnd);
PDC dc;
PWINDOW_OBJECT CurrentWindow;
if (NULL == Window)
{
@ -699,34 +700,50 @@ VOID FASTCALL DceMoveDCE(HWND hwnd, int X, int Y)
pDCE = FirstDce;
while (pDCE)
{
if (pDCE->DCXFlags & DCX_DCEEMPTY)
{
pDCE = pDCE->next;
continue;
}
if (pDCE->hwndCurrent == hwnd)
if (0 == (pDCE->DCXFlags & DCX_DCEEMPTY))
{
if (Window->Self == pDCE->hwndCurrent)
{
CurrentWindow = Window;
}
else
{
CurrentWindow = IntGetWindowObject(pDCE->hwndCurrent);
if (NULL == CurrentWindow)
{
pDCE = pDCE->next;
continue;
}
}
dc = DC_LockDc(pDCE->hDC);
if (dc == NULL)
{
if (Window->Self != pDCE->hwndCurrent)
{
IntReleaseWindowObject(CurrentWindow);
}
pDCE = pDCE->next;
continue;
}
dc->w.DCOrgX += X;
dc->w.DCOrgY += Y;
NtGdiOffsetRgn(dc->w.hClipRgn, X, Y);
if ((0 != DeltaX || 0 != DeltaY)
&& (Window == CurrentWindow || IntIsChildWindow(Window->Self, CurrentWindow->Self)))
{
dc->w.DCOrgX += DeltaX;
dc->w.DCOrgY += DeltaY;
NtGdiOffsetRgn(dc->w.hClipRgn, DeltaX, DeltaY);
NtGdiOffsetRgn(pDCE->hClipRgn, DeltaX, DeltaY);
}
DC_UnlockDc(pDCE->hDC);
NtGdiOffsetRgn(pDCE->hClipRgn, X, Y);
DceUpdateVisRgn(pDCE, Window, pDCE->DCXFlags);
IntReleaseWindowObject(Window);
DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags);
pDCE->DCXFlags |= DCX_DCEDIRTY;
if (Window->Self != pDCE->hwndCurrent)
{
IntReleaseWindowObject(CurrentWindow);
}
}
pDCE = pDCE->next;
}
IntReleaseWindowObject(Window);
}
/* EOF */

View file

@ -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.86 2004/02/03 09:44:35 gvg Exp $
/* $Id: winpos.c,v 1.87 2004/02/04 22:59:04 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -268,7 +268,7 @@ WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos)
{
WinPosGetMinMaxInfo(WindowObject, &Size, &InternalPos->MaxPos,
NULL, NULL);
DPRINT1("Maximize: %d,%d %dx%d\n",
DPRINT("Maximize: %d,%d %dx%d\n",
InternalPos->MaxPos.x, InternalPos->MaxPos.y, Size.x, Size.y);
if (WindowObject->Style & WS_MINIMIZE)
{
@ -599,10 +599,6 @@ WinPosInternalMoveWindow(PWINDOW_OBJECT Window, INT MoveX, INT MoveY)
Window->ClientRect.top += MoveY;
Window->ClientRect.bottom += MoveY;
#if 0
DceMoveDCE(Window->Self, MoveX, MoveY);
#endif
ExAcquireFastMutexUnsafe(&Window->ChildrenListLock);
Child = Window->FirstChild;
while (Child)
@ -877,6 +873,10 @@ 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);
/* Determine the new visible region */
VisAfter = VIS_ComputeVisibleRegion(Window, FALSE, FALSE, TRUE);