- Moved WM_ACTIVATEAPP calles before WM_NC/ACTIVATE calls.

- Implemented GetLastActivePopup, based on wine.
- Fixed DCE, pass all tests, except six clipping and one ROP check, which might be due to DCX_NORESETATTRS flag not being reset during the next GetDCEx call. <Researching>


svn path=/trunk/; revision=34289
This commit is contained in:
James Tabor 2008-07-04 04:55:18 +00:00
parent 8912b7b4c8
commit 709931f91a
5 changed files with 36 additions and 45 deletions

View file

@ -1,5 +1,4 @@
/* $Id$ /*
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/window.c * FILE: lib/user32/windows/window.c
@ -916,21 +915,21 @@ GetGUIThreadInfo(DWORD idThread,
/* /*
* @unimplemented * @implemented
*/ */
HWND STDCALL HWND STDCALL
GetLastActivePopup(HWND hWnd) GetLastActivePopup(HWND hWnd)
{ {
PWINDOW Wnd, WndParent; PWINDOW Wnd;
HWND Ret = NULL; HWND Ret = hWnd;
WARN("Not fully implemented!");
Wnd = ValidateHwnd(hWnd); Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL) if (Wnd != NULL)
{ {
_SEH_TRY _SEH_TRY
{ {
WndParent = NULL; if (Wnd->hWndLastActive)
Ret = hWnd; Ret = Wnd->hWndLastActive;
} }
_SEH_HANDLE _SEH_HANDLE
{ {

View file

@ -154,6 +154,8 @@ typedef struct _WINDOW
/* Context help id */ /* Context help id */
DWORD ContextHelpId; DWORD ContextHelpId;
HWND hWndLastActive;
struct struct
{ {
RECT NormalRect; RECT NormalRect;

View file

@ -16,7 +16,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id$
*/ */
#include <w32k.h> #include <w32k.h>
@ -85,17 +84,12 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, (LPARAM) hWnd); co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, (LPARAM) hWnd);
} }
UserDerefObjectCo(Window); if (Window->Wnd)
{ // Set last active for window and it's owner.
/* FIXME: IntIsWindow */ Window->Wnd->hWndLastActive = hWnd;
if (Window->Wnd->Owner)
CHECKPOINT; Window->Wnd->Owner->hWndLastActive = hWnd;
co_IntPostOrSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == UserGetForegroundWindow()), 0); }
/* FIXME: WA_CLICKACTIVE */
co_IntPostOrSendMessage(hWnd, WM_ACTIVATE,
MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
UserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE),
(LPARAM)hWndPrev);
if (Window && hWndPrev) if (Window && hWndPrev)
{ {
@ -133,6 +127,18 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
} }
} }
} }
UserDerefObjectCo(Window);
/* FIXME: IntIsWindow */
CHECKPOINT;
co_IntPostOrSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == UserGetForegroundWindow()), 0);
/* FIXME: WA_CLICKACTIVE */
co_IntPostOrSendMessage(hWnd, WM_ACTIVATE,
MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
UserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE),
(LPARAM)hWndPrev);
} }
} }

View file

@ -220,16 +220,6 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
dce->DCXFlags |= DCX_DCEEMPTY; dce->DCXFlags |= DCX_DCEEMPTY;
} }
} }
else
{ // Save Users Dc_Attr.
PDC dc = DC_LockDc(dce->hDC);
if(dc)
{
PDC_ATTR Dc_Attr = dc->pDc_Attr;
if(Dc_Attr) MmCopyFromCaller(&dc->Dc_Attr, Dc_Attr, sizeof(DC_ATTR));
DC_UnlockDc(dc);
}
}
dce->DCXFlags &= ~DCX_DCEBUSY; dce->DCXFlags &= ~DCX_DCEBUSY;
DPRINT("Exit!!!!! DCX_CACHE!!!!!! hDC-> %x \n", dce->hDC); DPRINT("Exit!!!!! DCX_CACHE!!!!!! hDC-> %x \n", dce->hDC);
if (!IntGdiSetDCOwnerEx( dce->hDC, GDI_OBJ_HMGR_NONE, FALSE)) if (!IntGdiSetDCOwnerEx( dce->hDC, GDI_OBJ_HMGR_NONE, FALSE))
@ -427,17 +417,8 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
// Window nz, check to see if we still own this or it is just cheap wine tonight. // Window nz, check to see if we still own this or it is just cheap wine tonight.
if (!(Flags & DCX_CACHE)) if (!(Flags & DCX_CACHE))
{ {
if ( Wnd->ti != GetW32ThreadInfo()) Flags |= DCX_CACHE; // Ah~ Not Powned! Forced to be cheap~ if ( Wnd->ti != GetW32ThreadInfo())
// Can only have one POWNED or CLASS. Flags |= DCX_CACHE; // Ah~ Not Powned! Forced to be cheap~
if ( !Window->Dce && (Wnd->Class->Style & CS_OWNDC))
Window->Dce = DceAllocDCE(NULL, DCE_WINDOW_DC);
else
Flags |= DCX_CACHE;
if ( !Wnd->Class->Dce && (Wnd->Class->Style & CS_CLASSDC))
Wnd->Class->Dce = DceAllocDCE(NULL, DCE_CLASS_DC);
else
Flags |= DCX_CACHE;
} }
DcxFlags = Flags & DCX_CACHECOMPAREMASK; DcxFlags = Flags & DCX_CACHECOMPAREMASK;
@ -455,7 +436,10 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
// Need to test for null here. Not sure if this is a bug or a feature. // Need to test for null here. Not sure if this is a bug or a feature.
// First time use hax, need to use DceAllocDCE during window display init. // First time use hax, need to use DceAllocDCE during window display init.
if (!Dce) break; if (!Dce) break;
//
// The way I understand this, you can have more than one DC per window.
// Only one Owned if one was requested and saved and one Cached.
//
if ((Dce->DCXFlags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE) if ((Dce->DCXFlags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE)
{ {
DceUnused = Dce; DceUnused = Dce;
@ -469,7 +453,6 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
#if 0 /* FIXME */ #if 0 /* FIXME */
UpdateVisRgn = FALSE; UpdateVisRgn = FALSE;
#endif #endif
UpdateClipOrigin = TRUE; UpdateClipOrigin = TRUE;
break; break;
} }
@ -531,8 +514,6 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
/* FIXME: Handle error */ /* FIXME: Handle error */
} }
Dce->DCXFlags = Flags | DCX_DCEBUSY;
if (!(Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && ClipRegion) if (!(Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && ClipRegion)
{ {
if (!(Flags & DCX_KEEPCLIPRGN)) if (!(Flags & DCX_KEEPCLIPRGN))
@ -547,6 +528,8 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
} }
#endif #endif
Dce->DCXFlags = Flags | DCX_DCEBUSY;
if (0 != (Flags & DCX_INTERSECTUPDATE) && NULL == ClipRegion) if (0 != (Flags & DCX_INTERSECTUPDATE) && NULL == ClipRegion)
{ {
Flags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN; Flags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN;

View file

@ -1627,6 +1627,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
Wnd->ti = ti; Wnd->ti = ti;
Wnd->pi = ti->kpi; Wnd->pi = ti->kpi;
Wnd->hWndLastActive = hWnd;
} }
DPRINT("Created object with handle %X\n", hWnd); DPRINT("Created object with handle %X\n", hWnd);