[PATCH 5/6] user32/focus: Don't continue activation if the window proc changed it when deactivated

Gabriel Ivăncescu gabrielopcode at gmail.com
Mon Dec 17 05:49:39 CST 2018


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---

See tests in next patch; changing the activation from within the WA_INACTIVE
message is kept by Windows.

 dlls/user32/focus.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c
index 4cde537..e34afa0 100644
--- a/dlls/user32/focus.c
+++ b/dlls/user32/focus.c
@@ -104,6 +104,9 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
             if (!SendMessageW( previous, WM_NCACTIVATE, FALSE, (LPARAM)hwnd )) goto clear_flags;
             SendMessageW( previous, WM_ACTIVATE,
                           MAKEWPARAM( WA_INACTIVE, IsIconic(previous) ), (LPARAM)hwnd );
+
+            /* Give up if the app changed the activation */
+            if (previous != GetActiveWindow()) goto clear_flags;
         }
     }
 
-- 
2.19.1




More information about the wine-devel mailing list