[PATCH 2/2] winex11.drv, winemac.drv: Don't send WM_CANCELMODE on focus loss.

Zebediah Figura z.figura12 at gmail.com
Tue Jan 30 18:33:34 CST 2018


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
This and the previous patch fix a WM-dependent failure. Most window managers
activate another window when one is minimized, including that of native
Windows. The test does in fact account for this, however, Wine currently
activates windows incorrectly, both by sending the WM_CANCELMODE message and
by failing to kill focus before minimizing a window.

This test was succeeding (inside todo_wine) on the testbot, which uses fvwm in
focus-follows-mouse mode, since in that case another window would never be
activated.

 dlls/user32/tests/msg.c   | 2 +-
 dlls/winemac.drv/window.c | 6 +-----
 dlls/winex11.drv/event.c  | 1 -
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 082b560..305d503 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -5087,7 +5087,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/winemac.drv/window.c b/dlls/winemac.drv/window.c
index ff140a1..48b44a6 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -2327,11 +2327,7 @@ void macdrv_window_lost_focus(HWND hwnd, const macdrv_event *event)
     TRACE("win %p/%p fg %p\n", hwnd, event->window, GetForegroundWindow());
 
     if (hwnd == GetForegroundWindow())
-    {
-        SendMessageW(hwnd, WM_CANCELMODE, 0, 0);
-        if (hwnd == GetForegroundWindow())
-            SetForegroundWindow(GetDesktopWindow());
-    }
+        SetForegroundWindow(GetDesktopWindow());
 }
 
 
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index a0bfe05..9bd4e11 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -804,7 +804,6 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev )
         return;
     }
     if (hwnd != GetForegroundWindow()) return;
-    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.7.4




More information about the wine-devel mailing list