Rémi Bernon : winex11.drv: Send HTMENU instead of HTCAPTION to query window activation.

Alexandre Julliard julliard at winehq.org
Thu Dec 26 15:44:38 CST 2019


Module: wine
Branch: master
Commit: cfcc280905b7804efde8f42bcd6bddbe5ebd8cad
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=cfcc280905b7804efde8f42bcd6bddbe5ebd8cad

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Dec 26 12:51:23 2019 +0100

winex11.drv: Send HTMENU instead of HTCAPTION to query window activation.

Commit 71d35d8940118bc6de6522913fb8c473fa5b2c24 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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index dd8837c11d..07f7a1ad50 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -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 );




More information about the wine-cvs mailing list