user32: IsChild must not consider the desktop window.

This commit is contained in:
Alexandre Julliard 2007-08-24 10:56:51 +02:00
parent 149cbb1b60
commit 8bbeadf565
5 changed files with 3 additions and 11 deletions

View File

@ -303,7 +303,7 @@ static inline BOOL is_mouse_message( UINT message )
/* check whether message matches the specified hwnd filter */ /* check whether message matches the specified hwnd filter */
static inline BOOL check_hwnd_filter( const MSG *msg, HWND 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 )); return (msg->hwnd == hwnd_filter || IsChild( hwnd_filter, msg->hwnd ));
} }

View File

@ -7476,9 +7476,7 @@ static void test_DestroyWindow(void)
/* test owner/parent of the parent */ /* test owner/parent of the parent */
test = GetParent(parent); test = GetParent(parent);
ok(!test, "wrong parent %p\n", test); ok(!test, "wrong parent %p\n", test);
todo_wine {
ok(!IsChild(GetDesktopWindow(), parent), "wrong parent/child %p/%p\n", GetDesktopWindow(), parent); ok(!IsChild(GetDesktopWindow(), parent), "wrong parent/child %p/%p\n", GetDesktopWindow(), parent);
}
if(pGetAncestor) { if(pGetAncestor) {
test = pGetAncestor(parent, GA_PARENT); test = pGetAncestor(parent, GA_PARENT);
ok(test == GetDesktopWindow(), "wrong parent %p\n", test); ok(test == GetDesktopWindow(), "wrong parent %p\n", test);

View File

@ -2758,27 +2758,21 @@ static void test_SetParent(void)
check_parents(child3, child2, child2, child2, 0, child2, parent); check_parents(child3, child2, child2, child2, 0, child2, parent);
check_parents(child4, desktop, child2, child2, child2, child4, 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, parent), "wrong parent/child %p/%p\n", desktop, parent);
ok(!IsChild(desktop, child1), "wrong parent/child %p/%p\n", desktop, child1); 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, child2), "wrong parent/child %p/%p\n", desktop, child2);
ok(!IsChild(desktop, child3), "wrong parent/child %p/%p\n", desktop, child3); 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(desktop, child4), "wrong parent/child %p/%p\n", desktop, child4);
}
ok(IsChild(parent, child1), "wrong parent/child %p/%p\n", parent, child1); 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(desktop, child2), "wrong parent/child %p/%p\n", desktop, child2);
}
ok(!IsChild(parent, child2), "wrong parent/child %p/%p\n", parent, 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(child1, child2), "wrong parent/child %p/%p\n", child1, child2);
ok(!IsChild(parent, child3), "wrong parent/child %p/%p\n", parent, child3); 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(child2, child3), "wrong parent/child %p/%p\n", child2, child3);
ok(!IsChild(parent, child4), "wrong parent/child %p/%p\n", parent, child4); ok(!IsChild(parent, child4), "wrong parent/child %p/%p\n", parent, child4);
ok(!IsChild(child3, child4), "wrong parent/child %p/%p\n", child3, 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); ok(!IsChild(desktop, child4), "wrong parent/child %p/%p\n", desktop, child4);
}
if (!is_win9x) /* Win9x doesn't survive this test */ if (!is_win9x) /* Win9x doesn't survive this test */
{ {

View File

@ -2609,7 +2609,7 @@ BOOL WINAPI IsChild( HWND parent, HWND child )
if (!list) return FALSE; if (!list) return FALSE;
parent = WIN_GetFullHandle( parent ); parent = WIN_GetFullHandle( parent );
for (i = 0; list[i]; i++) if (list[i] == parent) break; 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 ); HeapFree( GetProcessHeap(), 0, list );
return ret; return ret;
} }

View File

@ -391,7 +391,7 @@ void invalidate_dce( HWND hwnd, const RECT *rect )
/* check if DCE window is within the z-order scope */ /* 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) if (hwnd != dce->hwnd)
{ {