[PATCH v4 5/7] user32: Only process sent messages from driver in PeekMessage().

Zebediah Figura z.figura12 at gmail.com
Mon Mar 27 14:01:42 CDT 2017


Currently calling PeekMessage() will process all pending driver
events, causing e.g. the focus to change when one window has lost
it. However, this does not match Windows behaviour.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/user32/message.c   | 2 +-
 dlls/user32/tests/win.c | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index d13a9b0..4756910 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -3772,7 +3772,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageW( MSG *msg_out, HWND hwnd, UINT first,
         DWORD ret;
 
         flush_window_surfaces( TRUE );
-        ret = wow_handlers.wait_message( 0, NULL, 0, QS_ALLINPUT, 0 );
+        ret = wow_handlers.wait_message( 0, NULL, 0, QS_SENDMESSAGE, 0 );
         /* if we received driver events, check again for a pending message */
         if (ret == WAIT_TIMEOUT || !peek_message( &msg, hwnd, first, last, flags, 0 )) return FALSE;
     }
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index fef9cb0..449a82d 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3329,8 +3329,8 @@ static void test_SetForegroundWindow(HWND hwnd)
 
     while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
     if (0) check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
-    todo_wine ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow());
-    todo_wine ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus());
+    ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow());
+    ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus());
 
     SetForegroundWindow(hwnd);
     check_wnd_state(hwnd, hwnd, hwnd, 0);
@@ -6606,9 +6606,7 @@ static void test_EnableWindow(void)
     }
 
     ok(!IsWindowEnabled(hwnd), "window should not be enabled\n");
-    todo_wine
-        check_active_state(hwnd, hwnd, hwnd);
-    ok(0 == GetCapture(), "GetCapture() = %p\n", GetCapture());
+    check_wnd_state(hwnd, hwnd, hwnd, 0);
 
     CloseHandle(hthread);
     DestroyWindow(hwnd);
-- 
2.7.4




More information about the wine-patches mailing list