Ignore:
Timestamp:
Feb 24, 2000, 8:19:10 PM (26 years ago)
Author:
sandervl
Message:

WS_MAXIMIZE & WS_MINIMIZE flags updated when necessary & RedrawWindow changes

File:
1 edited

Legend:

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

    r2804 r2881  
    1 /* $Id: dc.cpp,v 1.48 2000-02-16 14:34:13 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.49 2000-02-24 19:19:07 sandervl Exp $ */
    22
    33/*
     
    3838#include <winerror.h>
    3939
    40 #define DBG_LOCALLOG    DBG_dc
     40#define DBG_LOCALLOG    DBG_dc
    4141#include "dbglocal.h"
    4242
     
    488488
    489489   pHps->hdcType = TYPE_3;
     490
     491   HideCaret(hwnd);
     492
     493   if(wnd->needsEraseBkgnd()) {
     494        wnd->setEraseBkgnd(FALSE);
     495        lpps->fErase = (wnd->MsgEraseBackGround(pHps->hps) != 0);
     496   }
     497   else lpps->fErase = TRUE;
    490498   lpps->hdc = (HDC)hps;
    491 
    492    if(!wnd->isSuppressErase()) {
    493         wnd->setSuppressErase(TRUE);
    494         wnd->setEraseBkgnd (FALSE, !wnd->MsgEraseBackGround(lpps->hdc));
    495    }
    496    lpps->fErase = wnd->isPSErase();
    497499
    498500   if (!hPS_ownDC)
     
    522524   dprintf (("USER32: EndPaint(%x)", hwnd));
    523525
     526   ShowCaret(hwnd);
    524527   if (!pPaint || !pPaint->hdc )
    525528      return TRUE;
     
    534537          WinEndPaint (pHps->hps);
    535538   }
    536    wnd->setSuppressErase(FALSE);
     539   wnd->setEraseBkgnd(TRUE);
    537540
    538541exit:
     
    618621   }
    619622
    620    if(!wnd->isSuppressErase() && lComplexity != RGN_NULL) {
    621         wnd->setSuppressErase(TRUE);
    622         wnd->setEraseBkgnd (FALSE, !wnd->MsgEraseBackGround(pHps->hps));
    623    }
    624    lpps->fErase = wnd->isPSErase(); //correct ??
     623   if(wnd->needsEraseBkgnd() && lComplexity != RGN_NULL) {
     624        wnd->setEraseBkgnd(FALSE);
     625        lpps->fErase = (wnd->MsgEraseBackGround(pHps->hps) != 0);
     626   }
     627   else lpps->fErase = TRUE;
     628
    625629   lpps->hdc    = (HDC)pHps->hps;
    626630
     
    683687        dprintf(("EndPaint: wrong hdc %x!!", pPaint->hdc));
    684688   }
    685    wnd->setSuppressErase(FALSE);
     689   wnd->setEraseBkgnd(TRUE);
    686690   ShowCaret(hwnd);
    687691
     
    10451049   if (redraw & (RDW_FRAME_W | RDW_NOFRAME_W))
    10461050   {
    1047       O32_SetLastError (ERROR_NOT_SUPPORTED);
    1048       return FALSE;
     1051        O32_SetLastError (ERROR_NOT_SUPPORTED);
     1052        return FALSE;
    10491053   }
    10501054
     
    10561060         return FALSE;
    10571061#else
    1058       hwnd = HWND_DESKTOP;
    1059       wnd  = Win32BaseWindow::GetWindowFromOS2Handle(OSLIB_HWND_DESKTOP);
    1060 
    1061       if (!wnd)
    1062       {
    1063          dprintf(("USER32:dc: RedrawWindow can't find desktop window %08xh\n",
     1062        hwnd = HWND_DESKTOP;
     1063        wnd  = Win32BaseWindow::GetWindowFromOS2Handle(OSLIB_HWND_DESKTOP);
     1064
     1065        if (!wnd)
     1066        {
     1067            dprintf(("USER32:dc: RedrawWindow can't find desktop window %08xh\n",
     1068                      hwnd));
     1069            O32_SetLastError (ERROR_INVALID_PARAMETER);
     1070            return FALSE;
     1071        }
     1072#endif
     1073   }
     1074   else
     1075   {
     1076        wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
     1077
     1078        if (!wnd)
     1079        {
     1080            dprintf(("USER32:dc: RedrawWindow can't find window %08xh\n",
    10641081                  hwnd));
    1065          O32_SetLastError (ERROR_INVALID_PARAMETER);
    1066          return FALSE;
    1067       }
    1068 #endif
    1069    }
    1070    else
    1071    {
    1072       wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    1073 
    1074       if (!wnd)
    1075       {
    1076          dprintf(("USER32:dc: RedrawWindow can't find window %08xh\n",
    1077                   hwnd));
    1078          O32_SetLastError (ERROR_INVALID_PARAMETER);
    1079          return FALSE;
    1080       }
    1081       hwnd = wnd->getOS2WindowHandle();
     1082            O32_SetLastError (ERROR_INVALID_PARAMETER);
     1083            return FALSE;
     1084        }
     1085        hwnd = wnd->getOS2WindowHandle();
    10821086   }
    10831087
     
    10881092   RECTL rectl;
    10891093
    1090    if (redraw & RDW_UPDATENOW_W) redraw &= ~RDW_ERASENOW_W;
    1091 
    1092    //SvL: Should we check if there is already an invalidated window part before
    1093    //     deciding to skip erase?
    1094    if(redraw & RDW_NOERASE_W || ((redraw & (RDW_INVALIDATE_W|RDW_ERASE_W|RDW_ERASENOW_W)) == RDW_INVALIDATE_W)) {
    1095         wnd->setSuppressErase(TRUE);
    1096    }
    1097    else wnd->setSuppressErase(FALSE);
    1098 
    10991094   if (hrgn)
    11001095   {
     
    11361131   if (redraw & RDW_INVALIDATE_W)
    11371132   {
    1138       if (redraw & RDW_ERASE_W)
    1139          wnd->setEraseBkgnd (TRUE, TRUE);
    1140 
    1141       if (!pRect && !hrgn)
    1142          success = WinInvalidateRect (hwnd, NULL, IncludeChildren);
    1143       else if (hrgn)
    1144          success = WinInvalidateRegion (hwnd, hrgnTemp, IncludeChildren);
    1145       else
    1146          success = WinInvalidateRect (hwnd, &rectl, IncludeChildren);
    1147       if (!success) goto error;
     1133        //TODO: SvL: pingpong.exe doesn't have RDW_NOERASE, but doesn't want WM_ERASEBKGND msgs
     1134        if (redraw & RDW_ERASE_W)
     1135            wnd->setEraseBkgnd (TRUE);
     1136
     1137        if (!pRect && !hrgn)
     1138            success = WinInvalidateRect (hwnd, NULL, IncludeChildren);
     1139        else
     1140        if (hrgn)
     1141            success = WinInvalidateRegion (hwnd, hrgnTemp, IncludeChildren);
     1142        else
     1143            success = WinInvalidateRect (hwnd, &rectl, IncludeChildren);
     1144
     1145        if (!success) goto error;
    11481146   }
    11491147   else if (redraw & RDW_VALIDATE_W)
    11501148   {
    1151       if (WinQueryUpdateRect (hwnd, NULL))
    1152       {
    1153          if (!pRect && !hrgn)
    1154             success = WinValidateRect (hwnd, NULL, IncludeChildren);
    1155          else if (hrgn)
    1156             success = WinValidateRegion (hwnd, hrgnTemp, IncludeChildren);
    1157          else
    1158             success = WinValidateRect (hwnd, &rectl, IncludeChildren);
    1159          if (!success) goto error;
    1160       }
     1149        if (redraw & RDW_NOERASE_W)
     1150            wnd->setEraseBkgnd(FALSE);
     1151
     1152        if (WinQueryUpdateRect (hwnd, NULL))
     1153        {
     1154            if (!pRect && !hrgn)
     1155                success = WinValidateRect (hwnd, NULL, IncludeChildren);
     1156            else
     1157            if (hrgn)
     1158                success = WinValidateRegion (hwnd, hrgnTemp, IncludeChildren);
     1159            else
     1160                success = WinValidateRect (hwnd, &rectl, IncludeChildren);
     1161            if (!success) goto error;
     1162        }
    11611163   }
    11621164
    11631165   if(WinQueryUpdateRect(hwnd, NULL))
    11641166   {
     1167        //TODO: Does this work if RDW_ALLCHILDREN is set??
    11651168        if(redraw & RDW_UPDATENOW_W) {
    11661169                wnd->MsgPaint (0, FALSE);
    11671170        }
    11681171        else
    1169         if((redraw & RDW_ERASE_W) && (redraw & RDW_ERASENOW_W))
    1170                 wnd->setEraseBkgnd (FALSE, !sendEraseBkgnd (wnd));
     1172//        if((redraw & RDW_ERASE_W) && (redraw & RDW_ERASENOW_W))
     1173        if(redraw & RDW_ERASENOW_W && wnd->needsEraseBkgnd())
     1174                wnd->setEraseBkgnd(sendEraseBkgnd(wnd) == 0);
    11711175   }
    11721176   else if((redraw & RDW_INTERNALPAINT_W) && !(redraw & RDW_INVALIDATE_W))
     
    11851189      WinReleasePS (hpsTemp);
    11861190
    1187 //SvL: Test
    1188 //   if ((redraw & RDW_INVALIDATE_W) == 0)
    1189 //      wnd->setSuppressErase (FALSE);
    1190 //   else if ((redraw & RDW_ERASENOW_W) == RDW_ERASENOW_W)
    1191 //      wnd->setSuppressErase (TRUE);
    1192 
    11931191   if (!success)
    11941192      O32_SetLastError (ERROR_INVALID_PARAMETER);
     
    12081206
    12091207   dprintf (("User32: UpdateWindow hwnd %x", hwnd));
    1210 ////SvL: This doesn't work right (it's what Wine does) -> TODO
    1211 ////   return RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW_W | RDW_NOCHILDREN_W);
     1208////SvL: This doesn't work right (Wine uses RDW_NOCHILDREN_W -> doesn't work here)
     1209////     Breaks vpbuddy
     1210////   return RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW_W | RDW_ALLCHILDREN_W);
    12121211   WinUpdateWindow(wnd->getOS2WindowHandle());
    12131212   return TRUE;
Note: See TracChangeset for help on using the changeset viewer.