winex11.drv: Reset focus if application does not want to be activated.
This commit is contained in:
parent
e28da99e4c
commit
e20625e5c9
|
@ -445,17 +445,18 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
|
||||||
LRESULT ma = SendMessageW( hwnd, WM_MOUSEACTIVATE,
|
LRESULT ma = SendMessageW( hwnd, WM_MOUSEACTIVATE,
|
||||||
(WPARAM)GetAncestor( hwnd, GA_ROOT ),
|
(WPARAM)GetAncestor( hwnd, GA_ROOT ),
|
||||||
MAKELONG(HTCAPTION,WM_LBUTTONDOWN) );
|
MAKELONG(HTCAPTION,WM_LBUTTONDOWN) );
|
||||||
if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE) set_focus( hwnd, event_time );
|
if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE)
|
||||||
else TRACE( "not setting focus to %p (%lx), ma=%ld\n", hwnd, event->window, ma );
|
{
|
||||||
}
|
set_focus( hwnd, event_time );
|
||||||
else
|
return;
|
||||||
{
|
}
|
||||||
hwnd = GetFocus();
|
|
||||||
if (hwnd) hwnd = GetAncestor( hwnd, GA_ROOT );
|
|
||||||
if (!hwnd) hwnd = GetActiveWindow();
|
|
||||||
if (!hwnd) hwnd = last_focus;
|
|
||||||
if (hwnd && can_activate_window(hwnd)) set_focus( hwnd, event_time );
|
|
||||||
}
|
}
|
||||||
|
/* try to find some other window to give the focus to */
|
||||||
|
hwnd = GetFocus();
|
||||||
|
if (hwnd) hwnd = GetAncestor( hwnd, GA_ROOT );
|
||||||
|
if (!hwnd) hwnd = GetActiveWindow();
|
||||||
|
if (!hwnd) hwnd = last_focus;
|
||||||
|
if (hwnd && can_activate_window(hwnd)) set_focus( hwnd, event_time );
|
||||||
}
|
}
|
||||||
else if (protocol == x11drv_atom(_NET_WM_PING))
|
else if (protocol == x11drv_atom(_NET_WM_PING))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue