[PATCH resend 2/3] winex11.drv: Only send WM_CANCELMODE if a menu is active.

Rémi Bernon rbernon at codeweavers.com
Wed Mar 4 08:53:23 CST 2020


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/user32/tests/msg.c  | 2 +-
 dlls/winex11.drv/event.c | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index aff4aeca24e..0bf255c4b63 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -5188,7 +5188,7 @@ static void test_messages(void)
 
     ShowWindow(hwnd, SW_MINIMIZE);
     flush_events();
-    ok_sequence(WmShowMinOverlappedSeq, "ShowWindow(SW_SHOWMINIMIZED):overlapped", TRUE);
+    ok_sequence(WmShowMinOverlappedSeq, "ShowWindow(SW_SHOWMINIMIZED):overlapped", FALSE);
     flush_sequence();
 
     if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MINIMIZE)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 07f7a1ad502..b68a64bd30b 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -819,6 +819,7 @@ static void focus_out( Display *display , HWND hwnd )
  {
     HWND hwnd_tmp;
     Window focus_win;
+    GUITHREADINFO threadinfo;
     int revert;
     XIC xic;
 
@@ -833,7 +834,12 @@ static void focus_out( Display *display , HWND hwnd )
         return;
     }
     if (hwnd != GetForegroundWindow()) return;
-    SendMessageW( hwnd, WM_CANCELMODE, 0, 0 );
+
+    threadinfo.cbSize = sizeof(threadinfo);
+    GetGUIThreadInfo(0, &threadinfo);
+
+    if (threadinfo.flags & (GUI_INMENUMODE|GUI_INMOVESIZE|GUI_POPUPMENUMODE|GUI_SYSTEMMENUMODE))
+        SendMessageW( hwnd, WM_CANCELMODE, 0, 0 );
 
     /* don't reset the foreground window, if the window which is
        getting the focus is a Wine window */
-- 
2.25.0




More information about the wine-devel mailing list