From d9d547168ccaea85775442600a6fd1fe1f7c8752 Mon Sep 17 00:00:00 2001 From: Noomen Hamza Date: Sat, 31 Jul 1999 19:35:58 +0000 Subject: [PATCH] Close the right window when clicking on a non active window close button. --- windows/nonclient.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/windows/nonclient.c b/windows/nonclient.c index 9a1546a6dd7..0e414826022 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -2305,20 +2305,6 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam ) sizingRect.bottom - sizingRect.top, ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); } - else - { - /* if the moving/resizing is canceled and the window is not active - * call SetWindowPos to activate and to show this window - */ - if (GetActiveWindow() != hwnd) - SetWindowPos( hwnd, 0, 0, 0,0,0,SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW); - } - } - else - { - /* show the window if it is not moved/resized and it is not active */ - if (GetActiveWindow() != hwnd) - SetWindowPos( hwnd, 0, 0, 0,0,0,SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW); } if( IsWindow(hwnd) ) @@ -2583,6 +2569,9 @@ LONG NC_HandleNCLButtonDown( WND* pWnd, WPARAM16 wParam, LPARAM lParam ) { HWND hwnd = pWnd->hwndSelf; + if(GetForegroundWindow() != hwnd) + SetWindowPos( hwnd, 0, 0, 0,0,0,SWP_NOSIZE | SWP_NOMOVE | SWP_DRAWFRAME); + switch(wParam) /* Hit test */ { case HTCAPTION: