Close the right window when clicking on a non active window close button.
diff --git a/windows/nonclient.c b/windows/nonclient.c index 9a1546a..0e41482 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c
@@ -2305,20 +2305,6 @@ 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 @@ { 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: