- 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
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/window.c
@ -916,21 +915,21 @@ GetGUIThreadInfo(DWORD idThread,
/*
* @unimplemented
* @implemented
*/
HWND STDCALL
GetLastActivePopup(HWND hWnd)
{
PWINDOW Wnd, WndParent;
HWND Ret = NULL;
WARN("Not fully implemented!");
PWINDOW Wnd;
HWND Ret = hWnd;
Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL)
{
_SEH_TRY
{
WndParent = NULL;
Ret = hWnd;
if (Wnd->hWndLastActive)
Ret = Wnd->hWndLastActive;
}
_SEH_HANDLE
{

View file

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

View file

@ -16,7 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
*/
#include <w32k.h>
@ -85,17 +84,12 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, (LPARAM) hWnd);
}
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);
if (Window->Wnd)
{ // Set last active for window and it's owner.
Window->Wnd->hWndLastActive = hWnd;
if (Window->Wnd->Owner)
Window->Wnd->Owner->hWndLastActive = hWnd;
}
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;
}
}
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;
DPRINT("Exit!!!!! DCX_CACHE!!!!!! hDC-> %x \n", dce->hDC);
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.
if (!(Flags & DCX_CACHE))
{
if ( Wnd->ti != GetW32ThreadInfo()) Flags |= DCX_CACHE; // Ah~ Not Powned! Forced to be cheap~
// Can only have one POWNED or CLASS.
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;
if ( Wnd->ti != GetW32ThreadInfo())
Flags |= DCX_CACHE; // Ah~ Not Powned! Forced to be cheap~
}
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.
// First time use hax, need to use DceAllocDCE during window display init.
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)
{
DceUnused = Dce;
@ -469,7 +453,6 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
#if 0 /* FIXME */
UpdateVisRgn = FALSE;
#endif
UpdateClipOrigin = TRUE;
break;
}
@ -531,8 +514,6 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
/* FIXME: Handle error */
}
Dce->DCXFlags = Flags | DCX_DCEBUSY;
if (!(Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && ClipRegion)
{
if (!(Flags & DCX_KEEPCLIPRGN))
@ -547,6 +528,8 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
}
#endif
Dce->DCXFlags = Flags | DCX_DCEBUSY;
if (0 != (Flags & DCX_INTERSECTUPDATE) && NULL == ClipRegion)
{
Flags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN;

View file

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