[PATCH v2 8/8] user32: Send WM_*FOCUS messages even if already focused.

Rémi Bernon rbernon at codeweavers.com
Thu Oct 1 05:20:04 CDT 2020


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

diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c
index 91b4b40af4e..43b86ae99ad 100644
--- a/dlls/user32/focus.c
+++ b/dlls/user32/focus.c
@@ -52,7 +52,6 @@ static HWND set_focus_window( HWND hwnd )
     }
     SERVER_END_REQ;
     if (!ret) return 0;
-    if (previous == hwnd) return previous;
 
     if (previous)
     {
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 4453363291a..264358a02c8 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3263,7 +3263,6 @@ struct test_sfw_test_desc
     BOOL call_set_active_window;
     BOOL call_set_focus;
 
-    BOOL todo_msgcount_before_set_foreground;
     int  msgcount_before_set_foreground;
     int  msgcount_after_set_foreground;
     int  msgcount_after_peek_message;
@@ -3271,26 +3270,26 @@ struct test_sfw_test_desc
 };
 
 static struct test_sfw_test_desc test_sfw_tests[] = {
-    {1, FALSE, FALSE, FALSE,  FALSE, 0, 0, 7, 0},
-    {1, TRUE, FALSE, FALSE,   FALSE, 0, 1, 7, 0},
-    {1, FALSE, TRUE, FALSE,   FALSE, 0, 0, 7, 0},
-    {1, TRUE, TRUE, FALSE,    FALSE, 0, 1, 7, 0},
-    {1, FALSE, FALSE, TRUE,   FALSE, 0, 0, 7, 0},
-    {1, TRUE, FALSE, TRUE,    FALSE, 0, 1, 7, 0},
-
-    {2, FALSE, FALSE, FALSE,  FALSE, 0, 6, 1, 1},
-    {2, TRUE, FALSE, FALSE,   FALSE, 0, 6, 1, 1},
-    {2, FALSE, TRUE, FALSE,   FALSE, 6, 0, 1, 1},
-    {2, TRUE, TRUE, FALSE,    FALSE, 6, 1, 7, 0},
-    {2, FALSE, FALSE, TRUE,    TRUE, 8, 0, 1, 1},
-    {2, TRUE, FALSE, TRUE,     TRUE, 8, 1, 7, 0},
-
-    {0, FALSE, FALSE, FALSE,  FALSE, 0, 6, 1, 1},
-    {0, TRUE, FALSE, FALSE,   FALSE, 0, 6, 1, 1},
-    {0, FALSE, TRUE, FALSE,   FALSE, 6, 0, 1, 1},
-    {0, TRUE, TRUE, FALSE,    FALSE, 6, 1, 7, 0},
-    {0, FALSE, FALSE, TRUE,    TRUE, 8, 0, 1, 1},
-    {0, TRUE, FALSE, TRUE,     TRUE, 8, 1, 7, 0},
+    {1, FALSE, FALSE, FALSE,  0, 0, 7, 0},
+    {1, TRUE, FALSE, FALSE,   0, 1, 7, 0},
+    {1, FALSE, TRUE, FALSE,   0, 0, 7, 0},
+    {1, TRUE, TRUE, FALSE,    0, 1, 7, 0},
+    {1, FALSE, FALSE, TRUE,   0, 0, 7, 0},
+    {1, TRUE, FALSE, TRUE,    0, 1, 7, 0},
+
+    {2, FALSE, FALSE, FALSE,  0, 6, 1, 1},
+    {2, TRUE, FALSE, FALSE,   0, 6, 1, 1},
+    {2, FALSE, TRUE, FALSE,   6, 0, 1, 1},
+    {2, TRUE, TRUE, FALSE,    6, 1, 7, 0},
+    {2, FALSE, FALSE, TRUE,   8, 0, 1, 1},
+    {2, TRUE, FALSE, TRUE,    8, 1, 7, 0},
+
+    {0, FALSE, FALSE, FALSE,  0, 6, 1, 1},
+    {0, TRUE, FALSE, FALSE,   0, 6, 1, 1},
+    {0, FALSE, TRUE, FALSE,   6, 0, 1, 1},
+    {0, TRUE, TRUE, FALSE,    6, 1, 7, 0},
+    {0, FALSE, FALSE, TRUE,   8, 0, 1, 1},
+    {0, TRUE, FALSE, TRUE,    8, 1, 7, 0},
 };
 
 static DWORD WINAPI test_sfw_thread( void *param )
@@ -3350,7 +3349,6 @@ static DWORD WINAPI test_sfw_thread( void *param )
         trace( "%d: before SetForegroundWindow\n", i );
         if (test->call_set_active_window) SetActiveWindow( windows[1] );
         if (test->call_set_focus) SetFocus( windows[1] );
-        todo_wine_if( test->todo_msgcount_before_set_foreground )
         ok( test_sfw_msg_count == test->msgcount_before_set_foreground,
             "%d: Unexpected number of messages received before SetForegroundWindow: %d\n", i, test_sfw_msg_count );
 
-- 
2.28.0




More information about the wine-devel mailing list