[PATCH 2/6] user32: Do not deactivate if thread is foreground.

Rémi Bernon rbernon at codeweavers.com
Mon Apr 27 02:06:22 CDT 2020


Instead of only checking that the window is foreground.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/user32/message.c   |  2 +-
 dlls/user32/tests/win.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 2717d91dbb51..af909f61f6d8 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -1873,7 +1873,7 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR
         if (is_desktop_window( hwnd )) return 0;
         return WIN_SetStyle(hwnd, wparam, lparam);
     case WM_WINE_SETACTIVEWINDOW:
-        if (!wparam && GetForegroundWindow() == hwnd) return 0;
+        if (!wparam && GetWindowThreadProcessId( GetForegroundWindow(), NULL ) == GetCurrentThreadId()) return 0;
         return (LRESULT)SetActiveWindow( (HWND)wparam );
     case WM_WINE_KEYBOARD_LL_HOOK:
     case WM_WINE_MOUSE_LL_HOOK:
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 46bc0952b73c..90c49a8f5c2b 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3284,18 +3284,18 @@ struct set_foreground_test_desc
 
 static struct set_foreground_test_desc set_foreground_tests[] = {
     {1, FALSE, FALSE, FALSE,  FALSE, 0, FALSE, 0, FALSE, 6, FALSE, 0},
-    {1, TRUE, FALSE, FALSE,   FALSE, 0,  TRUE, 1,  TRUE, 6,  TRUE, 0},
+    {1, TRUE, FALSE, FALSE,   FALSE, 0,  TRUE, 1, FALSE, 6, FALSE, 0},
     {1, FALSE, TRUE, FALSE,   FALSE, 0, FALSE, 0, FALSE, 6, FALSE, 0},
-    {1, TRUE, TRUE, FALSE,    FALSE, 0,  TRUE, 1,  TRUE, 6,  TRUE, 0},
+    {1, TRUE, TRUE, FALSE,    FALSE, 0,  TRUE, 1, FALSE, 6, FALSE, 0},
     {1, FALSE, FALSE, TRUE,   FALSE, 0, FALSE, 0, FALSE, 6, FALSE, 0},
-    {1, TRUE, FALSE, TRUE,    FALSE, 0,  TRUE, 1,  TRUE, 6,  TRUE, 0},
+    {1, TRUE, FALSE, TRUE,    FALSE, 0,  TRUE, 1, FALSE, 6, FALSE, 0},
 
     {2, FALSE, FALSE, FALSE,  FALSE, 0, FALSE, 6,  TRUE, 0,  TRUE, 1},
     {2, TRUE, FALSE, FALSE,   FALSE, 0, FALSE, 6,  TRUE, 0,  TRUE, 1},
     {2, FALSE, TRUE, FALSE,   FALSE, 6, FALSE, 0,  TRUE, 0,  TRUE, 1},
-    {2, TRUE, TRUE, FALSE,    FALSE, 6,  TRUE, 1,  TRUE, 6,  TRUE, 0},
+    {2, TRUE, TRUE, FALSE,    FALSE, 6,  TRUE, 1, FALSE, 6, FALSE, 0},
     {2, FALSE, FALSE, TRUE,    TRUE, 8, FALSE, 0,  TRUE, 0,  TRUE, 1},
-    {2, TRUE, FALSE, TRUE,     TRUE, 8,  TRUE, 1,  TRUE, 6,  TRUE, 0},
+    {2, TRUE, FALSE, TRUE,     TRUE, 8,  TRUE, 1, FALSE, 6, FALSE, 0},
 
     {0, FALSE, FALSE, FALSE,  FALSE, 0, FALSE, 6, FALSE, 0, FALSE, 1},
     {0, TRUE, FALSE, FALSE,   FALSE, 0, FALSE, 6,  TRUE, 0,  TRUE, 1},
-- 
2.26.1




More information about the wine-devel mailing list