mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
parent
ef40097fff
commit
6020629df1
8 changed files with 179 additions and 163 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: desktopbg.c,v 1.5 2004/01/11 17:31:16 gvg Exp $
|
||||
/* $Id: desktopbg.c,v 1.6 2004/01/17 15:18:25 navaraf Exp $
|
||||
*
|
||||
* reactos/subsys/csrss/win32csr/desktopbg.c
|
||||
*
|
||||
|
@ -149,7 +149,7 @@ DtbgDesktopThread(PVOID Data)
|
|||
}
|
||||
BackgroundWnd = CreateWindowW((LPCWSTR) DESKTOP_WINDOW_ATOM,
|
||||
L"",
|
||||
WS_POPUP,
|
||||
WS_POPUP | WS_CLIPCHILDREN,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: vis.h,v 1.5 2003/12/12 18:59:24 weiden Exp $
|
||||
/* $Id: vis.h,v 1.6 2004/01/17 15:18:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS Win32k subsystem
|
||||
|
@ -15,13 +15,11 @@
|
|||
#include <include/window.h>
|
||||
|
||||
HRGN FASTCALL
|
||||
VIS_ComputeVisibleRegion(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
||||
BOOLEAN ClientArea, BOOLEAN ClipChildren,
|
||||
BOOLEAN ClipSiblings);
|
||||
VIS_ComputeVisibleRegion(PWINDOW_OBJECT Window, BOOLEAN ClientArea,
|
||||
BOOLEAN ClipChildren, BOOLEAN ClipSiblings);
|
||||
|
||||
VOID FASTCALL
|
||||
VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
||||
HRGN UncoveredRgn);
|
||||
VIS_WindowLayoutChanged(PWINDOW_OBJECT Window, HRGN UncoveredRgn);
|
||||
|
||||
#endif /* ! defined(_WIN32K_VIS_H) */
|
||||
|
||||
|
|
|
@ -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: focus.c,v 1.12 2004/01/16 13:28:29 navaraf Exp $
|
||||
* $Id: focus.c,v 1.13 2004/01/17 15:18:25 navaraf Exp $
|
||||
*/
|
||||
|
||||
#include <win32k/win32k.h>
|
||||
|
@ -25,7 +25,7 @@
|
|||
#include <include/focus.h>
|
||||
#include <include/error.h>
|
||||
#include <include/winpos.h>
|
||||
//#define NDEBUG
|
||||
/* #define NDEBUG */
|
||||
#include <win32k/debug1.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -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: painting.c,v 1.61 2004/01/13 17:13:48 navaraf Exp $
|
||||
* $Id: painting.c,v 1.62 2004/01/17 15:18:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -64,8 +64,16 @@ IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion)
|
|||
HWND Parent;
|
||||
PWINDOW_OBJECT ParentWindow;
|
||||
|
||||
#ifdef FIN_DEBUG
|
||||
{
|
||||
RECT TempRect;
|
||||
UnsafeIntGetRgnBox(ValidRegion, &TempRect);
|
||||
DPRINT1("IntValidateParent ('%wZ', %d,%d-%d,%d)\n",
|
||||
&Child->WindowName, TempRect.left, TempRect.top, TempRect.right, TempRect.bottom);
|
||||
}
|
||||
#endif
|
||||
Parent = NtUserGetAncestor(Child->Self, GA_PARENT);
|
||||
while (Parent && Parent != IntGetDesktopWindow())
|
||||
while (Parent)
|
||||
{
|
||||
ParentWindow = IntGetWindowObject(Parent);
|
||||
if (ParentWindow && !(ParentWindow->Style & WS_CLIPCHILDREN))
|
||||
|
@ -163,6 +171,7 @@ IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
|
|||
{
|
||||
if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT)
|
||||
{
|
||||
IntValidateParent(Window, Window->NCUpdateRegion);
|
||||
IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)Window->NCUpdateRegion, 0);
|
||||
Window->NCUpdateRegion = NULL;
|
||||
Window->Flags &= ~WINDOWOBJECT_NEED_NCPAINT;
|
||||
|
@ -181,6 +190,7 @@ IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
|
|||
TempRect.left, TempRect.top, TempRect.right, TempRect.bottom);
|
||||
}
|
||||
#endif
|
||||
IntValidateParent(Window, Window->UpdateRegion);
|
||||
hDC = NtUserGetDCEx(hWnd, 0, DCX_CACHE | DCX_USESTYLE |
|
||||
DCX_INTERSECTUPDATE);
|
||||
if (hDC != NULL)
|
||||
|
@ -233,8 +243,7 @@ IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
|
|||
* Paint child windows.
|
||||
*/
|
||||
if (!(Flags & RDW_NOCHILDREN) && !(Window->Style & WS_MINIMIZE) &&
|
||||
((Flags & RDW_ALLCHILDREN) || !(Window->Style & WS_CLIPCHILDREN)) &&
|
||||
! IntIsDesktopWindow(Window))
|
||||
((Flags & RDW_ALLCHILDREN) || !(Window->Style & WS_CLIPCHILDREN)))
|
||||
{
|
||||
HWND *List, *phWnd;
|
||||
|
||||
|
@ -410,30 +419,6 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags,
|
|||
Window->WindowRect.left - Child->WindowRect.left,
|
||||
Window->WindowRect.top - Child->WindowRect.top);
|
||||
IntInvalidateWindows(Child, hRgnTemp, Flags, FALSE);
|
||||
|
||||
/*
|
||||
* WINDOWS REALLY DON'T DO THIS!!!
|
||||
*/
|
||||
#if 1
|
||||
/*
|
||||
* Update our UpdateRegion depending on children
|
||||
*/
|
||||
|
||||
if (Window->UpdateRegion != NULL)
|
||||
{
|
||||
NtGdiCombineRgn(hRgnTemp, Child->UpdateRegion, 0, RGN_COPY);
|
||||
NtGdiCombineRgn(hRgnTemp, hRgnTemp, Child->NCUpdateRegion, RGN_OR);
|
||||
NtGdiOffsetRgn(hRgnTemp,
|
||||
Child->WindowRect.left - Window->WindowRect.left,
|
||||
Child->WindowRect.top - Window->WindowRect.top);
|
||||
if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion,
|
||||
hRgnTemp, RGN_DIFF) == NULLREGION)
|
||||
{
|
||||
NtGdiDeleteObject(Window->UpdateRegion);
|
||||
Window->UpdateRegion = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
NtGdiDeleteObject(hRgnTemp);
|
||||
}
|
||||
IntReleaseWindowObject(Child);
|
||||
|
@ -563,10 +548,11 @@ IntRedrawWindow(PWINDOW_OBJECT Window, const RECT* UpdateRect, HRGN UpdateRgn,
|
|||
{
|
||||
IntInvalidateWindows(Window, hRgn, Flags, TRUE);
|
||||
} else
|
||||
if (Window->UpdateRegion != NULL && Flags & RDW_ERASENOW)
|
||||
if (Window->UpdateRegion != NULL && (Flags & (RDW_ERASENOW | RDW_UPDATENOW)))
|
||||
{
|
||||
/* Validate parent covered by region. */
|
||||
IntValidateParent(Window, Window->UpdateRegion);
|
||||
IntValidateParent(Window, Window->NCUpdateRegion);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -599,82 +585,50 @@ IntFindWindowToRepaint(HWND hWnd, PW32THREAD Thread)
|
|||
PWINDOW_OBJECT Child;
|
||||
HWND hFoundWnd = NULL;
|
||||
|
||||
if (hWnd == NULL)
|
||||
{
|
||||
PLIST_ENTRY CurrentEntry;
|
||||
|
||||
ExAcquireFastMutex(&Thread->WindowListLock);
|
||||
|
||||
for (CurrentEntry = Thread->WindowListHead.Flink;
|
||||
CurrentEntry != &Thread->WindowListHead;
|
||||
CurrentEntry = CurrentEntry->Flink)
|
||||
{
|
||||
Window = CONTAINING_RECORD(CurrentEntry, WINDOW_OBJECT, ThreadListEntry);
|
||||
if (Window->Parent != NULL && !IntIsDesktopWindow(Window->Parent))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (Window->Style & WS_VISIBLE)
|
||||
{
|
||||
hFoundWnd = IntFindWindowToRepaint(Window->Self, Thread);
|
||||
if (hFoundWnd != NULL)
|
||||
{
|
||||
ExReleaseFastMutex(&Thread->WindowListLock);
|
||||
return hFoundWnd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ExReleaseFastMutex(&Thread->WindowListLock);
|
||||
Window = IntGetWindowObject(hWnd);
|
||||
if (Window == NULL)
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
|
||||
if ((Window->UpdateRegion != NULL ||
|
||||
Window->Flags & (WINDOWOBJECT_NEED_INTERNALPAINT | WINDOWOBJECT_NEED_NCPAINT)) &&
|
||||
IntWndBelongsToThread(Window, Thread))
|
||||
{
|
||||
Window = IntGetWindowObject(hWnd);
|
||||
if (Window == NULL)
|
||||
return NULL;
|
||||
IntReleaseWindowObject(Window);
|
||||
return hWnd;
|
||||
}
|
||||
|
||||
if ((Window->UpdateRegion != NULL ||
|
||||
Window->Flags & (WINDOWOBJECT_NEED_INTERNALPAINT | WINDOWOBJECT_NEED_NCPAINT)) &&
|
||||
IntWndBelongsToThread(Window, Thread))
|
||||
ExAcquireFastMutex(&Window->ChildrenListLock);
|
||||
|
||||
for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
|
||||
{
|
||||
if (Child->Style & WS_VISIBLE &&
|
||||
(Child->UpdateRegion != NULL ||
|
||||
Child->Flags & WINDOWOBJECT_NEED_INTERNALPAINT ||
|
||||
Child->Flags & WINDOWOBJECT_NEED_NCPAINT)
|
||||
&& IntWndBelongsToThread(Child, Thread))
|
||||
{
|
||||
IntReleaseWindowObject(Window);
|
||||
return hWnd;
|
||||
hFoundWnd = Child->Self;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ExAcquireFastMutex(&Window->ChildrenListLock);
|
||||
|
||||
if (hFoundWnd == NULL)
|
||||
{
|
||||
for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
|
||||
{
|
||||
if (Child->Style & WS_VISIBLE &&
|
||||
(Child->UpdateRegion != NULL ||
|
||||
Child->Flags & WINDOWOBJECT_NEED_INTERNALPAINT ||
|
||||
Child->Flags & WINDOWOBJECT_NEED_NCPAINT)
|
||||
&& IntWndBelongsToThread(Child, Thread))
|
||||
if (Child->Style & WS_VISIBLE)
|
||||
{
|
||||
hFoundWnd = Child->Self;
|
||||
break;
|
||||
hFoundWnd = IntFindWindowToRepaint(Child->Self, Thread);
|
||||
if (hFoundWnd != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hFoundWnd == NULL)
|
||||
{
|
||||
for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
|
||||
{
|
||||
if (Child->Style & WS_VISIBLE)
|
||||
{
|
||||
hFoundWnd = IntFindWindowToRepaint(Child->Self, Thread);
|
||||
if (hFoundWnd != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ExReleaseFastMutex(&Window->ChildrenListLock);
|
||||
IntReleaseWindowObject(Window);
|
||||
|
||||
return hFoundWnd;
|
||||
}
|
||||
|
||||
ExReleaseFastMutex(&Window->ChildrenListLock);
|
||||
IntReleaseWindowObject(Window);
|
||||
|
||||
return hFoundWnd;
|
||||
}
|
||||
|
||||
BOOL FASTCALL
|
||||
|
@ -819,7 +773,6 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* lPs)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* IntRedrawWindow(Window, NULL, 0, RDW_NOINTERNALPAINT | RDW_VALIDATE | RDW_NOCHILDREN);*/
|
||||
#ifdef FIN_DEBUG
|
||||
if (Window->Flags & WINDOWOBJECT_NEED_ERASEBKGND)
|
||||
{
|
||||
|
|
|
@ -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: vis.c,v 1.15 2003/12/27 15:09:51 navaraf Exp $
|
||||
* $Id: vis.c,v 1.16 2004/01/17 15:18:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -30,11 +30,11 @@
|
|||
#include <include/rect.h>
|
||||
#include <include/vis.h>
|
||||
|
||||
|
||||
#define NDEBUG
|
||||
#include <win32k/debug1.h>
|
||||
#include <debug.h>
|
||||
|
||||
#if 1
|
||||
BOOL STATIC FASTCALL
|
||||
VIS_GetVisRect(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
||||
BOOLEAN ClientArea, RECT* Rect)
|
||||
|
@ -131,7 +131,7 @@ VIS_AddClipRects(PWINDOW_OBJECT Parent, PWINDOW_OBJECT End,
|
|||
}
|
||||
|
||||
HRGN FASTCALL
|
||||
VIS_ComputeVisibleRegion(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
||||
VIS_ComputeVisibleRegion(PWINDOW_OBJECT Window,
|
||||
BOOLEAN ClientArea, BOOLEAN ClipChildren,
|
||||
BOOLEAN ClipSiblings)
|
||||
{
|
||||
|
@ -140,6 +140,7 @@ VIS_ComputeVisibleRegion(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
|||
HRGN ClipRgn;
|
||||
PWINDOW_OBJECT DesktopWindow;
|
||||
INT LeftOffset, TopOffset;
|
||||
PDESKTOP_OBJECT Desktop = PsGetWin32Thread()->Desktop;
|
||||
|
||||
DesktopWindow = IntGetWindowObject(Desktop->DesktopWindow);
|
||||
if (NULL == DesktopWindow)
|
||||
|
@ -209,10 +210,94 @@ VIS_ComputeVisibleRegion(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
|||
|
||||
return VisRgn;
|
||||
}
|
||||
#else
|
||||
HRGN FASTCALL
|
||||
VIS_ComputeVisibleRegion(
|
||||
PWINDOW_OBJECT Window,
|
||||
BOOLEAN ClientArea,
|
||||
BOOLEAN ClipChildren,
|
||||
BOOLEAN ClipSiblings)
|
||||
{
|
||||
HRGN VisRgn, ClipRgn;
|
||||
INT LeftOffset, TopOffset;
|
||||
PWINDOW_OBJECT CurrentWindow;
|
||||
|
||||
if (!(Window->Style & WS_VISIBLE))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ClientArea)
|
||||
{
|
||||
VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->ClientRect);
|
||||
LeftOffset = Window->ClientRect.left;
|
||||
TopOffset = Window->ClientRect.top;
|
||||
}
|
||||
else
|
||||
{
|
||||
VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->WindowRect);
|
||||
LeftOffset = Window->WindowRect.left;
|
||||
TopOffset = Window->WindowRect.top;
|
||||
}
|
||||
|
||||
CurrentWindow = Window->Parent;
|
||||
while (CurrentWindow)
|
||||
{
|
||||
if (!(CurrentWindow->Style & WS_VISIBLE))
|
||||
{
|
||||
NtGdiDeleteObject(VisRgn);
|
||||
return NULL;
|
||||
}
|
||||
ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWindow->ClientRect);
|
||||
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND);
|
||||
NtGdiDeleteObject(ClipRgn);
|
||||
CurrentWindow = CurrentWindow->Parent;
|
||||
}
|
||||
|
||||
if (ClipChildren)
|
||||
{
|
||||
ExAcquireFastMutexUnsafe(&Window->ChildrenListLock);
|
||||
CurrentWindow = Window->FirstChild;
|
||||
while (CurrentWindow)
|
||||
{
|
||||
if (CurrentWindow->Style & WS_VISIBLE)
|
||||
{
|
||||
ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWindow->WindowRect);
|
||||
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
|
||||
NtGdiDeleteObject(ClipRgn);
|
||||
}
|
||||
CurrentWindow = CurrentWindow->NextSibling;
|
||||
}
|
||||
ExReleaseFastMutexUnsafe(&Window->ChildrenListLock);
|
||||
}
|
||||
|
||||
if (ClipSiblings && Window->Parent != NULL)
|
||||
{
|
||||
ExAcquireFastMutexUnsafe(&Window->Parent->ChildrenListLock);
|
||||
CurrentWindow = Window->Parent->FirstChild;
|
||||
while (CurrentWindow != Window)
|
||||
{
|
||||
if (CurrentWindow->Style & WS_VISIBLE)
|
||||
{
|
||||
ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWindow->WindowRect);
|
||||
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
|
||||
NtGdiDeleteObject(ClipRgn);
|
||||
}
|
||||
CurrentWindow = CurrentWindow->NextSibling;
|
||||
}
|
||||
ExReleaseFastMutexUnsafe(&Window->Parent->ChildrenListLock);
|
||||
}
|
||||
|
||||
NtGdiOffsetRgn(VisRgn, -LeftOffset, -TopOffset);
|
||||
|
||||
return VisRgn;
|
||||
}
|
||||
#endif
|
||||
|
||||
VOID FASTCALL
|
||||
VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
||||
HRGN NewlyExposed)
|
||||
VIS_WindowLayoutChanged(
|
||||
PWINDOW_OBJECT Window,
|
||||
HRGN NewlyExposed)
|
||||
{
|
||||
HRGN Temp;
|
||||
|
||||
|
|
|
@ -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.50 2004/01/13 17:13:48 navaraf Exp $
|
||||
/* $Id: windc.c,v 1.51 2004/01/17 15:18:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -70,7 +70,7 @@ DceGetVisRgn(HWND hWnd, ULONG Flags, HWND hWndChild, ULONG CFlags)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
VisRgn = VIS_ComputeVisibleRegion(PsGetWin32Thread()->Desktop, Window,
|
||||
VisRgn = VIS_ComputeVisibleRegion(Window,
|
||||
0 == (Flags & DCX_WINDOW),
|
||||
0 != (Flags & DCX_CLIPCHILDREN),
|
||||
0 != (Flags & DCX_CLIPSIBLINGS));
|
||||
|
@ -464,17 +464,7 @@ NtUserGetDCEx(HWND hWnd, HANDLE ClipRegion, ULONG Flags)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (hWnd == IntGetDesktopWindow())
|
||||
{
|
||||
hRgnVisible =
|
||||
NtGdiCreateRectRgn(0, 0,
|
||||
NtUserGetSystemMetrics(SM_CXSCREEN),
|
||||
NtUserGetSystemMetrics(SM_CYSCREEN));
|
||||
}
|
||||
else
|
||||
{
|
||||
hRgnVisible = DceGetVisRgn(hWnd, Flags, 0, 0);
|
||||
}
|
||||
hRgnVisible = DceGetVisRgn(hWnd, Flags, 0, 0);
|
||||
}
|
||||
|
||||
if (0 != (Flags & DCX_INTERSECTRGN))
|
||||
|
|
|
@ -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: window.c,v 1.175 2004/01/15 21:02:09 gvg Exp $
|
||||
/* $Id: window.c,v 1.176 2004/01/17 15:18:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -452,6 +452,7 @@ DestroyThreadWindows(struct _ETHREAD *Thread)
|
|||
LastHead = Win32Thread->WindowListHead.Flink;
|
||||
Window = CONTAINING_RECORD(Win32Thread->WindowListHead.Flink, WINDOW_OBJECT, ThreadListEntry);
|
||||
ExReleaseFastMutexUnsafe(&Win32Thread->WindowListLock);
|
||||
WinPosShowWindow(Window->Self, SW_HIDE);
|
||||
IntDestroyWindow(Window, Win32Process, Win32Thread, FALSE);
|
||||
ExAcquireFastMutexUnsafe(&Win32Thread->WindowListLock);
|
||||
}
|
||||
|
@ -608,7 +609,6 @@ VOID FASTCALL
|
|||
IntInitDesktopWindow(ULONG Width, ULONG Height)
|
||||
{
|
||||
PWINDOW_OBJECT DesktopWindow;
|
||||
HRGN DesktopRgn;
|
||||
|
||||
DesktopWindow = IntGetWindowObject(PsGetWin32Thread()->Desktop->DesktopWindow);
|
||||
if (NULL == DesktopWindow)
|
||||
|
@ -621,9 +621,7 @@ IntInitDesktopWindow(ULONG Width, ULONG Height)
|
|||
DesktopWindow->WindowRect.bottom = Height;
|
||||
DesktopWindow->ClientRect = DesktopWindow->WindowRect;
|
||||
|
||||
DesktopRgn = UnsafeIntCreateRectRgnIndirect(&(DesktopWindow->WindowRect));
|
||||
VIS_WindowLayoutChanged(PsGetWin32Thread()->Desktop, DesktopWindow, DesktopRgn);
|
||||
NtGdiDeleteObject(DesktopRgn);
|
||||
IntRedrawWindow(DesktopWindow, NULL, 0, RDW_INVALIDATE | RDW_ERASE);
|
||||
IntReleaseWindowObject(DesktopWindow);
|
||||
}
|
||||
|
||||
|
@ -1432,6 +1430,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
|||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED :
|
||||
SWP_NOZORDER | SWP_FRAMECHANGED;
|
||||
DPRINT("NtUserCreateWindow(): About to minimize/maximize\n");
|
||||
DPRINT("%d,%d %dx%d\n", NewPos.left, NewPos.top, NewPos.right, NewPos.bottom);
|
||||
WinPosSetWindowPos(WindowObject->Self, 0, NewPos.left, NewPos.top,
|
||||
NewPos.right, NewPos.bottom, SwFlag);
|
||||
}
|
||||
|
@ -1504,15 +1503,21 @@ NtUserDestroyWindow(HWND Wnd)
|
|||
/* Look whether the focus is within the tree of windows we will
|
||||
* be destroying.
|
||||
*/
|
||||
WinPosActivateOtherWindow(Window);
|
||||
/* FIXME: Lock */
|
||||
if (!WinPosShowWindow(Wnd, SW_HIDE))
|
||||
{
|
||||
if (NtUserGetActiveWindow() == Wnd)
|
||||
{
|
||||
WinPosActivateOtherWindow(Window);
|
||||
}
|
||||
}
|
||||
ExAcquireFastMutex(&Window->MessageQueue->Lock);
|
||||
if (Window->MessageQueue->ActiveWindow == Window->Self)
|
||||
Window->MessageQueue->ActiveWindow = NULL;
|
||||
if (Window->MessageQueue->FocusWindow == Window->Self)
|
||||
Window->MessageQueue->FocusWindow = NULL;
|
||||
if (Window->MessageQueue->CaptureWindow == Window->Self)
|
||||
Window->MessageQueue->CaptureWindow = NULL;
|
||||
/* FIXME: Unlock */
|
||||
ExReleaseFastMutex(&Window->MessageQueue->Lock);
|
||||
|
||||
/* Call hooks */
|
||||
#if 0 /* FIXME */
|
||||
|
@ -1544,19 +1549,6 @@ NtUserDestroyWindow(HWND Wnd)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* Hide the window */
|
||||
if (! WinPosShowWindow(Wnd, SW_HIDE ))
|
||||
{
|
||||
if (Wnd == NtUserGetActiveWindow())
|
||||
{
|
||||
PWINDOW_OBJECT ActiveWindow = IntGetWindowObject(Wnd);
|
||||
if (NULL != ActiveWindow)
|
||||
{
|
||||
WinPosActivateOtherWindow(ActiveWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!IntIsWindow(Wnd))
|
||||
{
|
||||
return TRUE;
|
||||
|
|
|
@ -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.80 2004/01/15 21:02:39 gvg Exp $
|
||||
/* $Id: winpos.c,v 1.81 2004/01/17 15:18:25 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -793,10 +793,10 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
SWP_HIDEWINDOW | SWP_FRAMECHANGED)) !=
|
||||
(SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER))
|
||||
{
|
||||
VisBefore = VIS_ComputeVisibleRegion(
|
||||
PsGetWin32Thread()->Desktop, Window, FALSE, FALSE, TRUE);
|
||||
VisBefore = VIS_ComputeVisibleRegion(Window, FALSE, FALSE, TRUE);
|
||||
|
||||
if (UnsafeIntGetRgnBox(VisBefore, &TempRect) == NULLREGION)
|
||||
if (VisBefore != NULL &&
|
||||
UnsafeIntGetRgnBox(VisBefore, &TempRect) == NULLREGION)
|
||||
{
|
||||
NtGdiDeleteObject(VisBefore);
|
||||
VisBefore = NULL;
|
||||
|
@ -878,10 +878,10 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
}
|
||||
|
||||
/* Determine the new visible region */
|
||||
VisAfter = VIS_ComputeVisibleRegion(
|
||||
PsGetWin32Thread()->Desktop, Window, FALSE, FALSE, TRUE);
|
||||
VisAfter = VIS_ComputeVisibleRegion(Window, FALSE, FALSE, TRUE);
|
||||
|
||||
if (UnsafeIntGetRgnBox(VisAfter, &TempRect) == NULLREGION)
|
||||
if (VisAfter != NULL &&
|
||||
UnsafeIntGetRgnBox(VisAfter, &TempRect) == NULLREGION)
|
||||
{
|
||||
NtGdiDeleteObject(VisAfter);
|
||||
VisAfter = NULL;
|
||||
|
@ -974,25 +974,24 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
/* We need to redraw what wasn't visible before */
|
||||
if (VisAfter != NULL)
|
||||
{
|
||||
DirtyRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
|
||||
if (CopyRgn != NULL)
|
||||
{
|
||||
DirtyRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
|
||||
RgnType = NtGdiCombineRgn(DirtyRgn, VisAfter, CopyRgn, RGN_DIFF);
|
||||
if (RgnType != ERROR && RgnType != NULLREGION)
|
||||
{
|
||||
NtGdiOffsetRgn(DirtyRgn,
|
||||
Window->WindowRect.left - Window->ClientRect.left,
|
||||
Window->WindowRect.top - Window->ClientRect.top);
|
||||
IntRedrawWindow(Window, NULL, DirtyRgn,
|
||||
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
||||
}
|
||||
NtGdiDeleteObject(DirtyRgn);
|
||||
}
|
||||
else
|
||||
{
|
||||
IntRedrawWindow(Window, NULL, 0,
|
||||
RgnType = NtGdiCombineRgn(DirtyRgn, VisAfter, 0, RGN_COPY);
|
||||
}
|
||||
if (RgnType != ERROR && RgnType != NULLREGION)
|
||||
{
|
||||
NtGdiOffsetRgn(DirtyRgn,
|
||||
Window->WindowRect.left - Window->ClientRect.left,
|
||||
Window->WindowRect.top - Window->ClientRect.top);
|
||||
IntRedrawWindow(Window, NULL, DirtyRgn,
|
||||
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
|
||||
}
|
||||
NtGdiDeleteObject(DirtyRgn);
|
||||
}
|
||||
|
||||
if (CopyRgn != NULL)
|
||||
|
@ -1014,8 +1013,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
|
||||
if (RgnType != ERROR && RgnType != NULLREGION)
|
||||
{
|
||||
VIS_WindowLayoutChanged(PsGetWin32Thread()->Desktop, Window,
|
||||
ExposedRgn);
|
||||
VIS_WindowLayoutChanged(Window, ExposedRgn);
|
||||
}
|
||||
NtGdiDeleteObject(ExposedRgn);
|
||||
NtGdiDeleteObject(VisBefore);
|
||||
|
|
Loading…
Reference in a new issue