From: Gabriel Ivăncescu Subject: [PATCH v2 5/6] user32/focus: Don't continue activation if the window proc changed it when deactivated Message-Id: <455fe7554edf2d2f0e02e11628cef77ebf4ecf6f.1556030499.git.gabrielopcode@gmail.com> Date: Tue, 23 Apr 2019 17:43:04 +0300 In-Reply-To: <371cd847dba6eaf94a17b4c6b47e8c0f78e26a22.1556030499.git.gabrielopcode@gmail.com> References: <371cd847dba6eaf94a17b4c6b47e8c0f78e26a22.1556030499.git.gabrielopcode@gmail.com> Signed-off-by: Gabriel Ivăncescu --- 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 834ceb1..1fac45d 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 activation was changed */ + if (previous != GetActiveWindow()) goto clear_flags; } } -- 2.21.0