From: Gabriel Ivăncescu Subject: [PATCH 3/6] user32/focus: Don't activate if the previous window doesn't want to be deactivated Message-Id: <786cfd914ef8c75d7b9f7dc18c6601298071537b.1548678703.git.gabrielopcode@gmail.com> Date: Mon, 28 Jan 2019 14:34:16 +0200 In-Reply-To: <9d7e2092f2b9e40d7e85c7e884d4f9b0cfa8952d.1548678703.git.gabrielopcode@gmail.com> References: <9d7e2092f2b9e40d7e85c7e884d4f9b0cfa8952d.1548678703.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.19.1