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

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


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/winemac.drv/window.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index 605c0c87f16..8091f5249fe 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -2368,13 +2368,18 @@ void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event)
  */
 void macdrv_window_lost_focus(HWND hwnd, const macdrv_event *event)
 {
+    GUITHREADINFO threadinfo;
     if (!hwnd) return;
 
     TRACE("win %p/%p fg %p\n", hwnd, event->window, GetForegroundWindow());
 
     if (hwnd == GetForegroundWindow())
     {
-        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);
+
         if (hwnd == GetForegroundWindow())
             SetForegroundWindow(GetDesktopWindow());
     }
-- 
2.25.0




More information about the wine-devel mailing list