winex11.drv: Send WM_MOUSEACTIVATE before closing a window.

This commit is contained in:
Lei Zhang 2007-06-18 14:00:04 -07:00 committed by Alexandre Julliard
parent cd20e11f4a
commit 9a67bded8c
1 changed files with 21 additions and 0 deletions

View File

@ -405,6 +405,27 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
if (state == 0xFFFFFFFF || (state & (MF_DISABLED | MF_GRAYED)))
return;
}
if (GetActiveWindow() != hwnd)
{
LRESULT ma = SendMessageW( hwnd, WM_MOUSEACTIVATE,
(WPARAM)GetAncestor( hwnd, GA_ROOT ),
MAKELONG(HTCLOSE,WM_LBUTTONDOWN) );
switch(ma)
{
case MA_NOACTIVATEANDEAT:
case MA_ACTIVATEANDEAT:
return;
case MA_NOACTIVATE:
break;
case MA_ACTIVATE:
case 0:
SetActiveWindow(hwnd);
break;
default:
WARN( "unknown WM_MOUSEACTIVATE code %d\n", (int) ma );
break;
}
}
PostMessageW( hwnd, WM_X11DRV_DELETE_WINDOW, 0, 0 );
}
}