Commit 9a67bded authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

winex11.drv: Send WM_MOUSEACTIVATE before closing a window.

parent cd20e11f
......@@ -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 );
}
}
......
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