Alexandre Julliard : user32/tests: Only check the foreground window when it belongs to the current thread.
Alexandre Julliard
julliard at winehq.org
Tue Jun 2 08:44:33 CDT 2009
Module: wine
Branch: master
Commit: f922283335ba93fea0df4e685f2298e2077328ac
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f922283335ba93fea0df4e685f2298e2077328ac
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Jun 2 11:56:58 2009 +0200
user32/tests: Only check the foreground window when it belongs to the current thread.
---
dlls/user32/tests/win.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 13e5d67..43988b5 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -2322,7 +2322,10 @@ static void check_wnd_state_(const char *file, int line,
HWND active, HWND foreground, HWND focus, HWND capture)
{
ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow());
- if (foreground && GetForegroundWindow())
+ /* only check foreground if it belongs to the current thread */
+ /* foreground can be moved to a different app pretty much at any time */
+ if (foreground && GetForegroundWindow() &&
+ GetWindowThreadProcessId(GetForegroundWindow(), NULL) == GetCurrentThreadId())
ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow());
ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus());
ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture());
More information about the wine-cvs
mailing list