Ignore:
Timestamp:
Jul 15, 2000, 10:08:01 AM (25 years ago)
Author:
sandervl
Message:

RDW_INVALIDATE fix in RedrawWindow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/dc.cpp

    r3800 r3821  
    1 /* $Id: dc.cpp,v 1.65 2000-07-04 08:42:05 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.66 2000-07-15 08:08:01 sandervl Exp $ */
    22
    33/*
     
    10441044            return FALSE;
    10451045        }
    1046         //TODO: If frame, exclude client window from update
    1047         if(redraw & RDW_FRAME_W) {
    1048                 hwnd = wnd->getOS2WindowHandle();
    1049         }
    1050         else    hwnd = wnd->getOS2WindowHandle();
    1051 
    1052    }
    1053 
    1054    BOOL  IncludeChildren = redraw & RDW_ALLCHILDREN_W ? TRUE : FALSE;
     1046        hwnd = wnd->getOS2WindowHandle();
     1047   }
     1048
     1049   BOOL  IncludeChildren = (redraw & RDW_ALLCHILDREN_W) ? TRUE : FALSE;
    10551050   BOOL  success = TRUE;
    10561051   HPS   hpsTemp = NULLHANDLE;
     
    11171112        if (hrgn) {
    11181113            success = WinInvalidateRegion (hwnd, hrgnTemp, IncludeChildren);
     1114            if(IncludeChildren && WinQueryUpdateRect(hwnd, NULL) == FALSE) {
     1115                dprintf(("WARNING: WinQueryUpdateRect %x region %x returned false even though we just invalidated part of a window!!!", hwnd, hrgnTemp));
     1116                success = success = WinInvalidateRegion (hwnd, hrgnTemp, FALSE);
     1117            }
    11191118        }
    1120         else
     1119        else {
    11211120            success = WinInvalidateRect (hwnd, &rectl, IncludeChildren);
    1122 
    1123 #ifdef DEBUG
    1124         if(WinQueryUpdateRect(hwnd, NULL) == FALSE) {
     1121//SvL: If all children are included, then WinInvalidateRect is called
     1122//     with fIncludeChildren=1 -> rect of hwnd isn't invalidated if child(ren)
     1123//     overlap(s) the specified rectangle completely (EVEN if window doesn't
     1124//     have WS_CLIPCHILREN!)
     1125//     -> example: XWing vs Tie Fighter install window
     1126//     WinInvalidateRect with fIncludeChildren=0 invalidates both the parent
     1127//     and child windows
     1128//SvL: Can't always set fIncludeChildren to FALSE or else some controls in
     1129//     the RealPlayer setup application aren't redrawn when invalidating
     1130//     their parent
     1131//     SO: Check if IncludeChildren is set and part of the window is invalid
     1132//         If not -> call WinInvalidateRect with IncludeChildren=0 to force
     1133//         the window rectangle to be invalidated
     1134//
     1135            if(IncludeChildren && WinQueryUpdateRect(hwnd, NULL) == FALSE) {
    11251136                dprintf(("WARNING: WinQueryUpdateRect %x (%d,%d)(%d,%d) returned false even though we just invalidated part of a window!!!", hwnd, rectl.xLeft, rectl.yBottom, rectl.xRight, rectl.yTop));
    1126         }
    1127 #endif
     1137                success = WinInvalidateRect (hwnd, &rectl, FALSE);
     1138            }
     1139        }
    11281140
    11291141        if (!success) goto error;
     
    11361148        if (WinQueryUpdateRect (hwnd, NULL))
    11371149        {
    1138             if (!pRect && !hrgn)
     1150            if(!pRect && !hrgn) {
    11391151                success = WinValidateRect (hwnd, NULL, IncludeChildren);
     1152            }
    11401153            else
    1141             if (hrgn) {
     1154            if(hrgn) {
    11421155                success = WinValidateRegion (hwnd, hrgnTemp, IncludeChildren);
    11431156            }
    1144             else
     1157            else {
    11451158                success = WinValidateRect (hwnd, &rectl, IncludeChildren);
    1146             if (!success) goto error;
     1159            }
     1160            if(!success) goto error;
    11471161        }
    11481162   }
     
    12351249   else dprintf(("InvalidateRect %x NULL erase=%d", hwnd, erase));
    12361250   result = RedrawWindow (hwnd, pRect, NULLHANDLE,
    1237 //SvL: If all children are included, then WinInvalidateRect is called
    1238 //     with fIncludeChildren=1 -> rect of hwnd isn't invalid if child(ren)
    1239 //     overlap(s) it completely (EVEN if window doesn't have WS_CLIPCHILREN!)
    1240 //     -> example: XWing vs Tie Fighter install window
    1241 //     WinInvalidateRect with fIncludeChildren=0 invalidates both the parent
    1242 //     and child windows
    1243 //                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
    1244                           RDW_NOCHILDREN_W | RDW_INVALIDATE_W |
     1251                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
    12451252                          (erase ? RDW_ERASE_W : RDW_NOERASE_W) |
    12461253                          (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0));
     
    12551262   dprintf(("InvalidateRgn %x %x erase=%d", hwnd, hrgn, erase));
    12561263   result = RedrawWindow (hwnd, NULL, hrgn,
    1257 //SvL: If all children are included, then WinInvalidateRegion is called
    1258 //     with fIncludeChildren=1 -> region of hwnd isn't invalid if child(ren)
    1259 //     overlap(s) it completely (EVEN if window doesn't have WS_CLIPCHILREN!)
    1260 //     -> example: XWing vs Tie Fighter install window
    1261 //     WinInvalidateRegion with fIncludeChildren=0 invalidates both the parent
    1262 //     and child windows
    1263 //                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
    1264                           RDW_NOCHILDREN_W | RDW_INVALIDATE_W |
     1264                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
    12651265                          (erase ? RDW_ERASE_W : RDW_NOERASE_W) |
    12661266                          (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0));
Note: See TracChangeset for help on using the changeset viewer.