Commit d5a1e761 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Make DestroyWindow() not mess with a window focus, this should be

taken care of by ShowWindow(SW_HIDE). Add a test for DestroyWindow() on a focused child.
parent 6a203fb8
......@@ -133,6 +133,9 @@ static const struct message WmDestroyChildSeq[] = {
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
{ WM_ERASEBKGND, sent|parent|optional },
{ WM_WINDOWPOSCHANGED, sent|wparam, 0 },
{ HCBT_SETFOCUS, hook }, /* set focus to a parent */
{ WM_KILLFOCUS, sent },
{ WM_IME_SETCONTEXT, sent|optional },
{ WM_DESTROY, sent },
{ WM_DESTROY, sent|optional }, /* a bug in win2k sp4 ? */
{ WM_NCDESTROY, sent },
......@@ -166,7 +169,7 @@ static const struct message WmDragTitleBarSeq[] = { /* FIXME: add */
{ 0 }
};
/* Sizing by dragging the thick borders (after WM_NCHITTEST and WM_SETCURSOR) (outline move) */
static const struct message WmDragThinkBordersBarSeq[] = { /* FIXME: add */
static const struct message WmDragThickBordersBarSeq[] = { /* FIXME: add */
{ WM_NCLBUTTONDOWN, sent|wparam, 0xd },
{ WM_SYSCOMMAND, sent|defwinproc|wparam, 0xf004 },
{ WM_GETMINMAXINFO, sent|defwinproc },
......@@ -480,6 +483,9 @@ static void test_messages(void)
ShowWindow(hchild, TRUE);
ok_sequence(WmShowChildSeq, "ShowWindow:child");
SetFocus(hchild);
flush_sequence();
MoveWindow(hchild, 10, 10, 20, 20, TRUE);
ok_sequence(WmResizingChildWithMoveWindowSeq, "MoveWindow:child");
......
......@@ -1475,7 +1475,6 @@ static void WIN_SendDestroyMsg( HWND hwnd )
BOOL WINAPI DestroyWindow( HWND hwnd )
{
BOOL is_child;
HWND h;
if (!(hwnd = WIN_IsCurrentThread( hwnd )) || (hwnd == GetDesktopWindow()))
{
......@@ -1485,17 +1484,6 @@ BOOL WINAPI DestroyWindow( HWND hwnd )
TRACE("(%p)\n", hwnd);
/* Look whether the focus is within the tree of windows we will
* be destroying.
*/
h = GetFocus();
if (h == hwnd || IsChild( hwnd, h ))
{
HWND parent = GetAncestor( hwnd, GA_PARENT );
if (parent == GetDesktopWindow()) parent = 0;
SetFocus( parent );
}
if (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_MDICHILD)
SendMessageW(GetAncestor(hwnd, GA_PARENT), WM_MDIREFRESHMENU, 0, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment