From f2616c5617bc5364df4e224e6659a76689f2fa70 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 18 May 2004 00:48:52 +0000 Subject: [PATCH] Only child windows receive WM_SHOWWINDOW in DestroyWindow() under Windows. --- windows/win.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/windows/win.c b/windows/win.c index 15e85c72383..e47ea3feacf 100644 --- a/windows/win.c +++ b/windows/win.c @@ -1429,6 +1429,7 @@ static void WIN_SendDestroyMsg( HWND hwnd ) if (GetGUIThreadInfo( GetCurrentThreadId(), &info )) { if (hwnd == info.hwndCaret) DestroyCaret(); + if (hwnd == info.hwndActive) WINPOS_ActivateOtherWindow( hwnd ); } if (USER_Driver.pResetSelectionOwner) USER_Driver.pResetSelectionOwner( hwnd, TRUE ); @@ -1505,10 +1506,13 @@ BOOL WINAPI DestroyWindow( HWND hwnd ) /* Hide the window */ - if (!ShowWindow( hwnd, SW_HIDE )) - { - if (hwnd == GetActiveWindow()) WINPOS_ActivateOtherWindow( hwnd ); - } + /* Only child windows receive WM_SHOWWINDOW in DestroyWindow() */ + if (is_child) + ShowWindow( hwnd, SW_HIDE ); + else + SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | + SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW ); + if (!IsWindow(hwnd)) return TRUE; /* Recursively destroy owned windows */