Alexandre Julliard : user: Don'
t bother checking the WS_VISIBLE style on the desktop window.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Aug 4 14:57:28 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 121f9c7e5525d6f28fa3c9781c0ab0e76d87d3bf
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=121f9c7e5525d6f28fa3c9781c0ab0e76d87d3bf
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Aug 4 20:45:55 2006 +0200
user: Don't bother checking the WS_VISIBLE style on the desktop window.
---
dlls/user/win.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/dlls/user/win.c b/dlls/user/win.c
index 68d6bb0..592eeac 100644
--- a/dlls/user/win.c
+++ b/dlls/user/win.c
@@ -249,7 +249,6 @@ static HWND *list_window_children( HWND
*
* Build an array of all parents of a given window, starting with
* the immediate parent. The array must be freed with HeapFree.
- * Returns NULL if window is a top-level window.
*/
static HWND *list_window_parents( HWND hwnd )
{
@@ -2611,14 +2610,17 @@ BOOL WINAPI IsChild( HWND parent, HWND c
BOOL WINAPI IsWindowVisible( HWND hwnd )
{
HWND *list;
- BOOL retval;
+ BOOL retval = TRUE;
int i;
if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) return FALSE;
if (!(list = list_window_parents( hwnd ))) return TRUE;
- for (i = 0; list[i]; i++)
- if (!(GetWindowLongW( list[i], GWL_STYLE ) & WS_VISIBLE)) break;
- retval = !list[i];
+ if (list[0] && list[1]) /* desktop window is considered always visible so we don't check it */
+ {
+ for (i = 0; list[i+1]; i++)
+ if (!(GetWindowLongW( list[i], GWL_STYLE ) & WS_VISIBLE)) break;
+ retval = !list[i+1];
+ }
HeapFree( GetProcessHeap(), 0, list );
return retval;
}
@@ -2634,7 +2636,7 @@ BOOL WINAPI IsWindowVisible( HWND hwnd )
BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL icon )
{
HWND *list;
- BOOL retval;
+ BOOL retval = TRUE;
int i;
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
@@ -2642,10 +2644,13 @@ BOOL WIN_IsWindowDrawable( HWND hwnd, BO
if ((style & WS_MINIMIZE) && icon && GetClassLongPtrW( hwnd, GCLP_HICON )) return FALSE;
if (!(list = list_window_parents( hwnd ))) return TRUE;
- for (i = 0; list[i]; i++)
- if ((GetWindowLongW( list[i], GWL_STYLE ) & (WS_VISIBLE|WS_MINIMIZE)) != WS_VISIBLE)
- break;
- retval = !list[i];
+ if (list[0] && list[1]) /* desktop window is considered always visible so we don't check it */
+ {
+ for (i = 0; list[i+1]; i++)
+ if ((GetWindowLongW( list[i], GWL_STYLE ) & (WS_VISIBLE|WS_MINIMIZE)) != WS_VISIBLE)
+ break;
+ retval = !list[i+1];
+ }
HeapFree( GetProcessHeap(), 0, list );
return retval;
}
More information about the wine-cvs
mailing list