Alexandre Julliard : user32: IsChild must not consider the desktop
window.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Aug 24 05:24:42 CDT 2007
Module: wine
Branch: master
Commit: 8bbeadf56509317bba6f496030ecef2bb5d2bd29
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8bbeadf56509317bba6f496030ecef2bb5d2bd29
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Aug 24 10:56:51 2007 +0200
user32: IsChild must not consider the desktop window.
---
dlls/user32/message.c | 2 +-
dlls/user32/tests/msg.c | 2 --
dlls/user32/tests/win.c | 6 ------
dlls/user32/win.c | 2 +-
dlls/winex11.drv/dce.c | 2 +-
5 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index c89a7ff..e87c428 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -303,7 +303,7 @@ static inline BOOL is_mouse_message( UINT message )
/* check whether message matches the specified hwnd filter */
static inline BOOL check_hwnd_filter( const MSG *msg, HWND hwnd_filter )
{
- if (!hwnd_filter) return TRUE;
+ if (!hwnd_filter || hwnd_filter == GetDesktopWindow()) return TRUE;
return (msg->hwnd == hwnd_filter || IsChild( hwnd_filter, msg->hwnd ));
}
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index af05f7b..502cefc 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -7476,9 +7476,7 @@ static void test_DestroyWindow(void)
/* test owner/parent of the parent */
test = GetParent(parent);
ok(!test, "wrong parent %p\n", test);
-todo_wine {
ok(!IsChild(GetDesktopWindow(), parent), "wrong parent/child %p/%p\n", GetDesktopWindow(), parent);
-}
if(pGetAncestor) {
test = pGetAncestor(parent, GA_PARENT);
ok(test == GetDesktopWindow(), "wrong parent %p\n", test);
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 3688bea..34aadb1 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -2758,27 +2758,21 @@ static void test_SetParent(void)
check_parents(child3, child2, child2, child2, 0, child2, parent);
check_parents(child4, desktop, child2, child2, child2, child4, parent);
-todo_wine {
ok(!IsChild(desktop, parent), "wrong parent/child %p/%p\n", desktop, parent);
ok(!IsChild(desktop, child1), "wrong parent/child %p/%p\n", desktop, child1);
ok(!IsChild(desktop, child2), "wrong parent/child %p/%p\n", desktop, child2);
ok(!IsChild(desktop, child3), "wrong parent/child %p/%p\n", desktop, child3);
ok(!IsChild(desktop, child4), "wrong parent/child %p/%p\n", desktop, child4);
-}
ok(IsChild(parent, child1), "wrong parent/child %p/%p\n", parent, child1);
-todo_wine {
ok(!IsChild(desktop, child2), "wrong parent/child %p/%p\n", desktop, child2);
-}
ok(!IsChild(parent, child2), "wrong parent/child %p/%p\n", parent, child2);
ok(!IsChild(child1, child2), "wrong parent/child %p/%p\n", child1, child2);
ok(!IsChild(parent, child3), "wrong parent/child %p/%p\n", parent, child3);
ok(IsChild(child2, child3), "wrong parent/child %p/%p\n", child2, child3);
ok(!IsChild(parent, child4), "wrong parent/child %p/%p\n", parent, child4);
ok(!IsChild(child3, child4), "wrong parent/child %p/%p\n", child3, child4);
-todo_wine {
ok(!IsChild(desktop, child4), "wrong parent/child %p/%p\n", desktop, child4);
-}
if (!is_win9x) /* Win9x doesn't survive this test */
{
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index 0ef021a..41eb108 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -2609,7 +2609,7 @@ BOOL WINAPI IsChild( HWND parent, HWND child )
if (!list) return FALSE;
parent = WIN_GetFullHandle( parent );
for (i = 0; list[i]; i++) if (list[i] == parent) break;
- ret = (list[i] != 0);
+ ret = list[i] && list[i+1];
HeapFree( GetProcessHeap(), 0, list );
return ret;
}
diff --git a/dlls/winex11.drv/dce.c b/dlls/winex11.drv/dce.c
index 3b80308..72c5429 100644
--- a/dlls/winex11.drv/dce.c
+++ b/dlls/winex11.drv/dce.c
@@ -391,7 +391,7 @@ void invalidate_dce( HWND hwnd, const RECT *rect )
/* check if DCE window is within the z-order scope */
- if (hwndScope == dce->hwnd || IsChild( hwndScope, dce->hwnd ))
+ if (hwndScope == dce->hwnd || hwndScope == GetDesktopWindow() || IsChild( hwndScope, dce->hwnd ))
{
if (hwnd != dce->hwnd)
{
More information about the wine-cvs
mailing list