From: Gabriel Ivăncescu Subject: [PATCH v2 3/6] user32/focus: Don't activate if the previous window doesn't want to be deactivated Message-Id: <7139751e98438360faa25abb7832044c6126e644.1556030499.git.gabrielopcode@gmail.com> Date: Tue, 23 Apr 2019 17:43:02 +0300 In-Reply-To: <371cd847dba6eaf94a17b4c6b47e8c0f78e26a22.1556030499.git.gabrielopcode@gmail.com> References: <371cd847dba6eaf94a17b4c6b47e8c0f78e26a22.1556030499.git.gabrielopcode@gmail.com> On Windows, if WM_NCACTIVATE returns FALSE, the window should not be able to be deactivated. Signed-off-by: Gabriel Ivăncescu --- dlls/user32/focus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 0d32d00..834ceb1 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -101,7 +101,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) if (IsWindow(previous)) { - SendMessageW( previous, WM_NCACTIVATE, FALSE, (LPARAM)hwnd ); + if (!SendMessageW( previous, WM_NCACTIVATE, FALSE, (LPARAM)hwnd )) goto clear_flags; SendMessageW( previous, WM_ACTIVATE, MAKEWPARAM( WA_INACTIVE, IsIconic(previous) ), (LPARAM)hwnd ); } -- 2.21.0