Test whether an active maximized MDI child is visible

Dmitry Timoshkov dmitry at baikal.ru
Thu Jan 29 10:21:07 CST 2004


Hello,

this patch fixes a crash in one of MDI apps which simply is not ready
to resize an invisible MDI child.

(Perhaps we need to handle WM_SHOWWINDOW message and deactivate that child
in DefMDIChildProc instead).

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Test whether an active maximized MDI child is visible.

--- cvs/hq/wine/windows/mdi.c	2004-01-27 15:31:30.000000000 +0800
+++ wine/windows/mdi.c	2004-01-30 00:07:28.000000000 +0800
@@ -980,7 +980,7 @@ static void MDI_UpdateFrameText( HWND fr
 
     if (ci->frameTitle)
     {
-	if (IsZoomed(ci->hwndActiveChild))
+	if (IsZoomed(ci->hwndActiveChild) && IsWindowVisible(ci->hwndActiveChild))
 	{
 	    /* combine frame title and child title if possible */
 
@@ -1216,7 +1216,8 @@ static LRESULT MDIClientWndProc_common( 
         return 0;
 
       case WM_SIZE:
-        if( IsWindow(ci->hwndActiveChild) && IsZoomed(ci->hwndActiveChild) )
+        if( IsWindow(ci->hwndActiveChild) && IsZoomed(ci->hwndActiveChild) &&
+            IsWindowVisible(ci->hwndActiveChild) )
 	{
 	    RECT	rect;
 
@@ -1506,6 +1507,9 @@ LRESULT WINAPI DefMDIChildProcW( HWND hw
         break;
 
     case WM_SIZE:
+        if (wParam == SIZE_MAXIMIZED && !IsWindowVisible(hwnd))
+            wParam = SIZE_RESTORED;
+
         if( hwnd == ci->hwndActiveChild && wParam != SIZE_MAXIMIZED )
         {
             MDI_RestoreFrameMenu( GetParent(client), hwnd );






More information about the wine-patches mailing list