Skip to content

Commit

Permalink
winex11.drv: Send HTMENU instead of HTCAPTION to query window activat…
Browse files Browse the repository at this point in the history
…ion.

Commit 71d35d8 broke the way
WM_TAKE_FOCUS protocol is implemented: WM_MOUSEACTIVATE now replies
MA_NOACTIVATE by default when using HTCAPTION.

We use the WM_MOUSEACTIVATE -although Windows does not- regardless of
the way focus is changed to check whether a window wants focus, and
Windows sometimes changes focus regardless of the message reply.

Steam and the Wine system tray are affected for instance.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
  • Loading branch information
rbernon authored and julliard committed Dec 26, 2019
1 parent 6c47355 commit cfcc280
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dlls/winex11.drv/event.c
Expand Up @@ -706,7 +706,7 @@ static void handle_wm_protocols( HWND hwnd, XClientMessageEvent *event )
* whether the window wants to be activated */
LRESULT ma = SendMessageW( hwnd, WM_MOUSEACTIVATE,
(WPARAM)GetAncestor( hwnd, GA_ROOT ),
MAKELONG(HTCAPTION,WM_LBUTTONDOWN) );
MAKELONG( HTMENU, WM_LBUTTONDOWN ) );
if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE)
{
set_focus( event->display, hwnd, event_time );
Expand Down

0 comments on commit cfcc280

Please sign in to comment.