- Continuing the moving into WND structure with minor desktop structure changes.
- Tested: wine user32 tests, AbiWord 2.6.8, FF 3.5, OOo 2.4.3 and Seamonkey 2.0.

svn path=/trunk/; revision=44576
This commit is contained in:
James Tabor 2009-12-14 06:48:40 +00:00
parent d51b4d5202
commit f755214f06
11 changed files with 66 additions and 69 deletions

View file

@ -27,7 +27,7 @@ typedef struct _DESKTOP
PWIN32HEAP pheapDesktop;
PSECTION_OBJECT DesktopHeapSection;
PDESKTOPINFO DesktopInfo;
PDESKTOPINFO pDeskInfo;
PWND spwndMessage;
} DESKTOP, *PDESKTOP;

View file

@ -27,8 +27,6 @@ typedef struct _WINDOW_OBJECT
/* Pointer to the thread information */
PTHREADINFO pti; // Use Wnd->head.pti
/* Pointer to the desktop */
PDESKTOPINFO Desktop;
/* system menu handle. */
HMENU SystemMenu;
/* Entry in the thread's list of windows. */
@ -36,7 +34,7 @@ typedef struct _WINDOW_OBJECT
/* Handle for the window. */
HWND hSelf;
/* Window flags. */
ULONG Flags;
ULONG state;
/* Handle of region of the window to be updated. */
HANDLE UpdateRegion;
/* Handle of the window region. */
@ -59,7 +57,6 @@ typedef struct _WINDOW_OBJECT
PWINDOW_SCROLLINFO Scroll;
PETHREAD OwnerThread; // Use Wnd->head.pti
HWND hWndLastPopup; /* handle to last active popup window (wine doesn't use pointer, for unk. reason)*/
ULONG Status;
/* counter for tiled child windows */
ULONG TiledCounter;
/* WNDOBJ list */
@ -67,14 +64,14 @@ typedef struct _WINDOW_OBJECT
} WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
/* Window flags. */
#define WINDOWOBJECT_NEED_SIZE (0x00000001) // WNDS_SENDSIZEMOVEMSGS?
#define WINDOWOBJECT_NEED_ERASEBKGND (0x00000002) // WNDS_ERASEBACKGROUND
#define WINDOWOBJECT_NEED_NCPAINT (0x00000004) // WNDS_SENDNCPAINT
#define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000008) // WNDS_INTERNALPAINT
#define WINDOWOBJECT_NEED_SIZE WNDS_SENDSIZEMOVEMSGS
#define WINDOWOBJECT_NEED_ERASEBKGND WNDS_ERASEBACKGROUND
#define WINDOWOBJECT_NEED_NCPAINT WNDS_SENDNCPAINT
#define WINDOWOBJECT_NEED_INTERNALPAINT WNDS_INTERNALPAINT
#define WINDOWOBJECT_RESTOREMAX (0x00000020) // Set/Clr WS_MAXIMIZE && Clr/Set WS_EX2_VERTICALLYMAXIMIZEDLEFT/RIGHT
#define WINDOWSTATUS_DESTROYING (0x1) // WNDS2_INDESTROY
#define WINDOWSTATUS_DESTROYED (0x2) // WNDS_DESTROYED
#define WINDOWSTATUS_DESTROYING WNDS2_INDESTROY
#define WINDOWSTATUS_DESTROYED WNDS_DESTROYED
#define HAS_DLGFRAME(Style, ExStyle) \
(((ExStyle) & WS_EX_DLGMODALFRAME) || \

View file

@ -1032,23 +1032,23 @@ NtUserCreateDesktop(
DesktopInfoSize = FIELD_OFFSET(DESKTOPINFO,
szDesktopName[(lpszDesktopName->Length / sizeof(WCHAR)) + 1]);
DesktopObject->DesktopInfo = RtlAllocateHeap(DesktopObject->pheapDesktop,
DesktopObject->pDeskInfo = RtlAllocateHeap(DesktopObject->pheapDesktop,
HEAP_NO_SERIALIZE,
DesktopInfoSize);
if (DesktopObject->DesktopInfo == NULL)
if (DesktopObject->pDeskInfo == NULL)
{
ObDereferenceObject(DesktopObject);
DPRINT1("Failed to create the DESKTOP structure!\n");
RETURN(NULL);
}
RtlZeroMemory(DesktopObject->DesktopInfo,
RtlZeroMemory(DesktopObject->pDeskInfo,
DesktopInfoSize);
DesktopObject->DesktopInfo->pvDesktopBase = DesktopHeapSystemBase;
DesktopObject->DesktopInfo->pvDesktopLimit = (PVOID)((ULONG_PTR)DesktopHeapSystemBase + HeapSize);
RtlCopyMemory(DesktopObject->DesktopInfo->szDesktopName,
DesktopObject->pDeskInfo->pvDesktopBase = DesktopHeapSystemBase;
DesktopObject->pDeskInfo->pvDesktopLimit = (PVOID)((ULONG_PTR)DesktopHeapSystemBase + HeapSize);
RtlCopyMemory(DesktopObject->pDeskInfo->szDesktopName,
lpszDesktopName->Buffer,
lpszDesktopName->Length);
@ -1928,7 +1928,7 @@ IntMapDesktopView(IN PDESKTOP DesktopObject)
if (GetWin32ClientInfo()->pDeskInfo == NULL)
{
GetWin32ClientInfo()->pDeskInfo =
(PVOID)((ULONG_PTR)DesktopObject->DesktopInfo -
(PVOID)((ULONG_PTR)DesktopObject->pDeskInfo -
GetWin32ClientInfo()->ulClientDelta);
}
}
@ -1979,7 +1979,7 @@ IntSetThreadDesktop(IN PDESKTOP DesktopObject,
pci->ulClientDelta = DesktopHeapGetUserDelta();
if (DesktopObject)
{
pci->pDeskInfo = (PVOID)((ULONG_PTR)DesktopObject->DesktopInfo - pci->ulClientDelta);
pci->pDeskInfo = (PVOID)((ULONG_PTR)DesktopObject->pDeskInfo - pci->ulClientDelta);
}
}

View file

@ -1462,7 +1462,7 @@ IntKeyboardInput(KEYBDINPUT *ki)
Msg.hwnd = FocusMessageQueue->FocusWindow;
DPRINT("Msg.hwnd = %x\n", Msg.hwnd);
FocusMessageQueue->Desktop->DesktopInfo->LastInputWasKbd = TRUE;
FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
IntGetCursorLocation(FocusMessageQueue->Desktop->WindowStation,
&Msg.pt);

View file

@ -571,7 +571,7 @@ co_IntTranslateMouseMessage(
{
/* post the message to the other window */
Msg->hwnd = Wnd->hSelf;
if(!(Wnd->Status & WINDOWSTATUS_DESTROYING))
if(!(Wnd->state & WINDOWSTATUS_DESTROYING))
{
MsqPostMessage(Wnd->MessageQueue, Msg, FALSE,
Msg->message == WM_MOUSEMOVE ? QS_MOUSEMOVE :
@ -1163,7 +1163,7 @@ UserPostMessage( HWND Wnd,
return FALSE;
}
if ( Window->Status & WINDOWSTATUS_DESTROYING )
if ( Window->state & WINDOWSTATUS_DESTROYING )
{
DPRINT1("Attempted to post message to window 0x%x that is being destroyed!\n", Wnd);
/* FIXME - last error code? */
@ -1290,7 +1290,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
RETURN( FALSE);
}
if (Window->Status & WINDOWSTATUS_DESTROYING)
if (Window->state & WINDOWSTATUS_DESTROYING)
{
/* FIXME - last error? */
DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
@ -1457,7 +1457,7 @@ co_IntDoSendMessage( HWND hWnd,
}
/* Check for an exiting window. */
if (Window && Window->Status & WINDOWSTATUS_DESTROYING)
if (Window && Window->state & WINDOWSTATUS_DESTROYING)
{
DPRINT1("co_IntDoSendMessage Window Exiting!\n");
}

View file

@ -471,7 +471,7 @@ GetW32ThreadInfo(VOID)
if (pti->Desktop != NULL)
{
pti->pDeskInfo = pti->Desktop->DesktopInfo;
pti->pDeskInfo = pti->Desktop->pDeskInfo;
}
else
{

View file

@ -839,7 +839,7 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
Msg.hwnd = FocusMessageQueue->FocusWindow;
DPRINT("Msg.hwnd = %x\n", Msg.hwnd);
FocusMessageQueue->Desktop->DesktopInfo->LastInputWasKbd = TRUE;
FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
IntGetCursorLocation(FocusMessageQueue->Desktop->WindowStation,
&Msg.pt);

View file

@ -195,7 +195,7 @@ IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess());
GreDeleteObject(Window->UpdateRegion);
Window->UpdateRegion = NULL;
if (!(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT))
if (!(Window->state & WINDOWOBJECT_NEED_INTERNALPAINT))
MsqDecPaintCountQueue(Window->MessageQueue);
}
}
@ -237,17 +237,17 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
if (Flags & RDW_UPDATENOW)
{
if (Window->UpdateRegion != NULL ||
Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
Window->state & WINDOWOBJECT_NEED_INTERNALPAINT)
{
co_IntSendMessage(hWnd, WM_PAINT, 0, 0);
}
}
else
{
if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT)
if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
{
TempRegion = IntGetNCUpdateRgn(Window, TRUE);
Window->Flags &= ~WINDOWOBJECT_NEED_NCPAINT;
Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
MsqDecPaintCountQueue(Window->MessageQueue);
co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0);
if ((HANDLE) 1 != TempRegion && NULL != TempRegion)
@ -257,7 +257,7 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
}
}
if (Window->Flags & WINDOWOBJECT_NEED_ERASEBKGND)
if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
{
if (Window->UpdateRegion)
{
@ -266,7 +266,7 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
DCX_INTERSECTRGN | DCX_KEEPCLIPRGN);
if (co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0))
{
Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
}
UserReleaseDC(Window, hDC, FALSE);
}
@ -367,8 +367,8 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
*/
HadPaintMessage = Window->UpdateRegion != NULL ||
Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT;
HadNCPaintMessage = Window->Flags & WINDOWOBJECT_NEED_NCPAINT;
Window->state & WINDOWOBJECT_NEED_INTERNALPAINT;
HadNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
/*
* Update the region and flags
@ -391,9 +391,9 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
}
if (Flags & RDW_FRAME)
Window->Flags |= WINDOWOBJECT_NEED_NCPAINT;
Window->state |= WINDOWOBJECT_NEED_NCPAINT;
if (Flags & RDW_ERASE)
Window->Flags |= WINDOWOBJECT_NEED_ERASEBKGND;
Window->state |= WINDOWOBJECT_NEED_ERASEBKGND;
Flags |= RDW_FRAME;
}
@ -412,21 +412,21 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
}
if (Window->UpdateRegion == NULL)
Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
if (Flags & RDW_NOFRAME)
Window->Flags &= ~WINDOWOBJECT_NEED_NCPAINT;
Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
if (Flags & RDW_NOERASE)
Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
}
if (Flags & RDW_INTERNALPAINT)
{
Window->Flags |= WINDOWOBJECT_NEED_INTERNALPAINT;
Window->state |= WINDOWOBJECT_NEED_INTERNALPAINT;
}
if (Flags & RDW_NOINTERNALPAINT)
{
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
Window->state &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
}
/*
@ -459,8 +459,8 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
*/
HasPaintMessage = Window->UpdateRegion != NULL ||
Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT;
HasNCPaintMessage = Window->Flags & WINDOWOBJECT_NEED_NCPAINT;
Window->state & WINDOWOBJECT_NEED_INTERNALPAINT;
HasNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
if (HasPaintMessage != HadPaintMessage)
{
@ -612,8 +612,8 @@ IntIsWindowDirty(PWINDOW_OBJECT Window)
PWND Wnd = Window->Wnd;
return (Wnd->style & WS_VISIBLE) &&
((Window->UpdateRegion != NULL) ||
(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) ||
(Window->Flags & WINDOWOBJECT_NEED_NCPAINT));
(Window->state & WINDOWOBJECT_NEED_INTERNALPAINT) ||
(Window->state & WINDOWOBJECT_NEED_NCPAINT));
}
HWND FASTCALL
@ -770,12 +770,12 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
co_UserHideCaret(Window);
if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT)
if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
{
HRGN hRgn;
hRgn = IntGetNCUpdateRgn(Window, FALSE);
Window->Flags &= ~WINDOWOBJECT_NEED_NCPAINT;
Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
MsqDecPaintCountQueue(Window->MessageQueue);
co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)hRgn, 0);
if (hRgn != (HANDLE)1 && hRgn != NULL)
@ -803,17 +803,17 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
}
else
{
if (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
if (Window->state & WINDOWOBJECT_NEED_INTERNALPAINT)
MsqDecPaintCountQueue(Window->MessageQueue);
IntGetClientRect(Window, &Ps.rcPaint);
}
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
Window->state &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
if (Window->Flags & WINDOWOBJECT_NEED_ERASEBKGND)
if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
{
Window->Flags &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Ps.fErase = !co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)Ps.hdc, 0);
}
else

View file

@ -68,8 +68,8 @@ VIS_ComputeVisibleRegion(
CurrentWindow = Window->spwndParent;
while (CurrentWindow)
{
if ( CurrentWindow->Status & WINDOWSTATUS_DESTROYING ||
CurrentWindow->Status & WINDOWSTATUS_DESTROYED )
if ( CurrentWindow->state & WINDOWSTATUS_DESTROYING || // state2
CurrentWindow->state & WINDOWSTATUS_DESTROYED )
{
DPRINT1("ATM the Current Window or Parent is dead!\n");
return NULL;

View file

@ -123,7 +123,7 @@ PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd)
}
Window = (PWINDOW_OBJECT)UserGetObject(gHandleTable, hWnd, otWindow);
if (!Window || 0 != (Window->Status & WINDOWSTATUS_DESTROYED))
if (!Window || 0 != (Window->state & WINDOWSTATUS_DESTROYED))
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return NULL;
@ -365,12 +365,12 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
Wnd = Window->Wnd;
if(Window->Status & WINDOWSTATUS_DESTROYING)
if(Window->state & WINDOWSTATUS_DESTROYING)
{
DPRINT("Tried to call IntDestroyWindow() twice\n");
return 0;
}
Window->Status |= WINDOWSTATUS_DESTROYING;
Window->state |= WINDOWSTATUS_DESTROYING;
Wnd->style &= ~WS_VISIBLE;
IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Wnd, OBJID_WINDOW, 0);
@ -431,7 +431,7 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
MsqRemoveWindowMessagesFromQueue(Window);
/* from now on no messages can be sent to this window anymore */
Window->Status |= WINDOWSTATUS_DESTROYED;
Window->state |= WINDOWSTATUS_DESTROYED;
Wnd->state |= WNDS_DESTROYED;
Wnd->fnid |= FNID_FREED;
@ -1315,7 +1315,7 @@ IntAnyPopup(VOID)
BOOL FASTCALL
IntIsWindowInDestroy(PWINDOW_OBJECT Window)
{
return ((Window->Status & WINDOWSTATUS_DESTROYING) == WINDOWSTATUS_DESTROYING);
return ((Window->state & WINDOWSTATUS_DESTROYING) == WINDOWSTATUS_DESTROYING);
}
@ -1339,7 +1339,7 @@ IntGetWindowPlacement(PWINDOW_OBJECT Window, WINDOWPLACEMENT *lpwndpl)
{
lpwndpl->showCmd = SW_HIDE;
}
else if (0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) ||
else if (0 != (Window->state & WINDOWOBJECT_RESTOREMAX) ||
0 != (Wnd->style & WS_MAXIMIZE))
{
lpwndpl->showCmd = SW_MAXIMIZE;
@ -1850,7 +1850,7 @@ AllocErr:
{
/* If there is no desktop window yet, we must be creating it */
pti->Desktop->DesktopWindow = hWnd;
pti->Desktop->DesktopInfo->Wnd = Wnd;
pti->Desktop->pDeskInfo->Wnd = Wnd;
}
/*
@ -2014,7 +2014,7 @@ AllocErr:
if (!(dwStyle & WS_POPUP))
{
dwStyle |= WS_CAPTION;
Window->Flags |= WINDOWOBJECT_NEED_SIZE;
Window->state |= WINDOWOBJECT_NEED_SIZE;
DPRINT("4: Style is now %lx\n", dwStyle);
}
}
@ -2334,7 +2334,7 @@ AllocErr:
IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window->Wnd, OBJID_WINDOW, 0);
/* Send move and size messages. */
if (!(Window->Flags & WINDOWOBJECT_NEED_SIZE))
if (!(Window->state & WINDOWOBJECT_NEED_SIZE))
{
LONG lParam;
@ -4070,7 +4070,7 @@ NtUserGetWindowPlacement(HWND hWnd,
{
Safepl.showCmd = SW_HIDE;
}
else if ((0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) ||
else if ((0 != (Window->state & WINDOWOBJECT_RESTOREMAX) ||
0 != (Wnd->style & WS_MAXIMIZE)) &&
0 == (Wnd->style & WS_MINIMIZE))
{

View file

@ -325,12 +325,12 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
{
if (Wnd->style & WS_MAXIMIZE)
{
Window->Flags |= WINDOWOBJECT_RESTOREMAX;
Window->state |= WINDOWOBJECT_RESTOREMAX;
Wnd->style &= ~WS_MAXIMIZE;
}
else
{
Window->Flags &= ~WINDOWOBJECT_RESTOREMAX;
Window->state &= ~WINDOWOBJECT_RESTOREMAX;
}
co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
RDW_NOINTERNALPAINT);
@ -364,7 +364,7 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
if (Wnd->style & WS_MINIMIZE)
{
Wnd->style &= ~WS_MINIMIZE;
if (Window->Flags & WINDOWOBJECT_RESTOREMAX)
if (Window->state & WINDOWOBJECT_RESTOREMAX)
{
co_WinPosGetMinMaxInfo(Window, &Size,
&Wnd->InternalPos.MaxPos, NULL, NULL);
@ -1478,12 +1478,12 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
/* FIXME: Check for window destruction. */
if ((Window->Flags & WINDOWOBJECT_NEED_SIZE) &&
!(Window->Status & WINDOWSTATUS_DESTROYING))
if ((Window->state & WINDOWOBJECT_NEED_SIZE) &&
!(Window->state & WINDOWSTATUS_DESTROYING))
{
WPARAM wParam = SIZE_RESTORED;
Window->Flags &= ~WINDOWOBJECT_NEED_SIZE;
Window->state &= ~WINDOWOBJECT_NEED_SIZE;
if (Wnd->style & WS_MAXIMIZE)
{
wParam = SIZE_MAXIMIZED;