Changeset 9933
- Timestamp:
- Mar 22, 2003, 9:27:12 PM (22 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/user32/dc.cpp ¶
r8800 r9933 1 /* $Id: dc.cpp,v 1.11 7 2002-06-28 19:45:00 sandervl Exp $ */1 /* $Id: dc.cpp,v 1.118 2003-03-22 20:27:10 sandervl Exp $ */ 2 2 3 3 /* … … 679 679 bIcon = IsIconic(hwnd); 680 680 681 //check if the application previously didn't handle a WM_PAINT msg properly 682 wnd->checkForDirtyUpdateRegion(); 683 681 684 HWND hwndClient = (bIcon) ? wnd->getOS2FrameWindowHandle() : wnd->getOS2WindowHandle(); 682 685 … … 1207 1210 else hwnd = wnd->getOS2WindowHandle(); 1208 1211 } 1212 1213 //check if the application previously didn't handle a WM_PAINT msg properly 1214 wnd->checkForDirtyUpdateRegion(); 1209 1215 1210 1216 BOOL IncludeChildren = (redraw & RDW_ALLCHILDREN_W) ? TRUE : FALSE; … … 1383 1389 } 1384 1390 1391 //check if the application previously didn't handle a WM_PAINT msg properly 1392 wnd->checkForDirtyUpdateRegion(); 1393 1385 1394 #ifdef DEBUG 1386 1395 if(WinQueryUpdateRect(wnd->getOS2WindowHandle(), &rectl)) -
TabularUnified trunk/src/user32/dcrgn.cpp ¶
r6902 r9933 1 /* $Id: dcrgn.cpp,v 1. 7 2001-09-30 22:24:41 sandervl Exp $ */1 /* $Id: dcrgn.cpp,v 1.8 2003-03-22 20:27:11 sandervl Exp $ */ 2 2 3 3 /* … … 65 65 dprintf(("GetUpdateRect %x %x %d", hwnd, pRect, erase)); 66 66 67 //check if the application previously didn't handle a WM_PAINT msg properly 68 wnd->checkForDirtyUpdateRegion(); 69 67 70 BOOL updateRegionExists = WinQueryUpdateRect(wnd->getOS2WindowHandle(), pRect ? &rectl : NULL); 68 71 if (!pRect) { … … 118 121 return ERROR_W; 119 122 } 123 //check if the application previously didn't handle a WM_PAINT msg properly 124 wnd->checkForDirtyUpdateRegion(); 125 120 126 lComplexity = WinQueryUpdateRegion(wnd->getOS2WindowHandle(), hrgn); 121 127 if(lComplexity == RGN_ERROR) { -
TabularUnified trunk/src/user32/pmwindow.cpp ¶
r9930 r9933 1 /* $Id: pmwindow.cpp,v 1.20 2 2003-03-20 13:20:44sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.203 2003-03-22 20:27:11 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 866 866 BOOL rc; 867 867 868 win32wnd->checkForDirtyUpdateRegion(); 869 868 870 rc = WinQueryUpdateRect(hwnd, &rectl); 869 871 dprintf(("OS2: WM_PAINT %x (%d,%d) (%d,%d) rc=%d", win32wnd->getWindowHandle(), rectl.xLeft, rectl.yBottom, rectl.xRight, rectl.yTop, rc)); … … 873 875 { 874 876 win32wnd->DispatchMsgA(pWinMsg); 877 if(WinQueryUpdateRect(hwnd, NULL) == TRUE) 878 {//the application didn't validate the update region; Windows 879 //will only send a WM_PAINT once until another part of the 880 //window is invalidated. Unfortunately PM keeps on sending 881 //WM_PAINT messages until we validate the update region. 882 883 win32wnd->saveAndValidateUpdateRegion(); 884 } 875 885 } 876 886 else goto RunDefWndProc; -
TabularUnified trunk/src/user32/win32wbase.cpp ¶
r9930 r9933 1 /* $Id: win32wbase.cpp,v 1.36 2 2003-03-20 13:20:45sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.363 2003-03-22 20:27:12 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 119 119 fEraseBkgndFlag = TRUE; 120 120 fIsDragDropActive= FALSE; 121 fDirtyUpdateRegion = FALSE; 121 122 122 123 state = STATE_INIT; … … 174 175 hWindowRegion = 0; 175 176 hClipRegion = 0; 177 hUpdateRegion = 0; 176 178 177 179 hTaskList = 0; … … 272 274 if(propertyList) { 273 275 removeWindowProps(); 276 } 277 if(hUpdateRegion) { 278 DeleteObject(hUpdateRegion); 279 hUpdateRegion = NULL; 274 280 } 275 281 } … … 1190 1196 else 1191 1197 return SendMessageA(getWindowHandle(),WM_PAINT, 0, 0); 1198 } 1199 //****************************************************************************** 1200 // 1201 // Win32BaseWindow::saveAndValidateUpdateRegion 1202 // 1203 // If an application doesn't validate the update region while processing 1204 // WM_PAINT, then we must remember it for the next time. Also validates 1205 // the current update region. 1206 // 1207 // Parameters: 1208 // Returns: 1209 // 1210 // NOTE: 1211 // Windows will only send a WM_PAINT once until another part of the 1212 // window is invalidated. Unfortunately PM keeps on sending 1213 // WM_PAINT messages until we validate the update region. 1214 // 1215 // This affects UpdateWindow, RedrawWindow, GetUpdateRgn, GetUpdateRect, 1216 // BeginPaint and the next WM_PAINT message. 1217 // 1218 //****************************************************************************** 1219 void Win32BaseWindow::saveAndValidateUpdateRegion() 1220 { 1221 if(hUpdateRegion == NULL) { 1222 hUpdateRegion = ::CreateRectRgn(0, 0, 1, 1); 1223 } 1224 1225 dprintf(("Win32BaseWindow::saveAndValidateUpdateRegion; marked dirty!")); 1226 1227 //save update region 1228 ::GetUpdateRgn(getWindowHandle(), hUpdateRegion, FALSE); 1229 1230 //and validate it so PM won't bother us again 1231 ::ValidateRgn(getWindowHandle(), hUpdateRegion); 1232 1233 //we just pretend the entire window is invalid. easier this way 1234 fDirtyUpdateRegion = TRUE; 1235 } 1236 //****************************************************************************** 1237 // 1238 // Win32BaseWindow::checkForDirtyUpdateRegion 1239 // 1240 // If an application doesn't validate the update region while processing 1241 // WM_PAINT, then we must remember it for the next time. If the window has 1242 // a dirty update region, then invalidate that region. 1243 // 1244 // Parameters: 1245 // Returns: 1246 // 1247 // NOTE: 1248 // 1249 //****************************************************************************** 1250 void Win32BaseWindow::checkForDirtyUpdateRegion() 1251 { 1252 if(fDirtyUpdateRegion) { 1253 dprintf(("Win32BaseWindow::checkForDirtyUpdateRegion; marked dirty -> invalidate whole window!")); 1254 fDirtyUpdateRegion = FALSE; 1255 ::InvalidateRgn(getWindowHandle(), hUpdateRegion, TRUE); 1256 } 1192 1257 } 1193 1258 //****************************************************************************** -
TabularUnified trunk/src/user32/win32wbase.h ¶
r9930 r9933 1 /* $Id: win32wbase.h,v 1.1 49 2003-03-20 13:20:46sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.150 2003-03-22 20:27:12 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 230 230 void SetClipRegion(HRGN hRegion) { hClipRegion = hRegion; }; 231 231 232 void saveAndValidateUpdateRegion(); 233 void checkForDirtyUpdateRegion(); 234 BOOL hasDirtUpdateRegion() { return fDirtyUpdateRegion; }; 235 232 236 BOOL ShowWindow(ULONG nCmdShow); 233 237 virtual BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags, BOOL fShowWindow = FALSE); … … 416 420 fVisibleRegionChanged:1, //set when visible region has changed -> erase background must be sent during next BeginPaint 417 421 fEraseBkgndFlag:1, 418 fIsDragDropActive:1; 422 fIsDragDropActive:1, 423 fDirtyUpdateRegion:1; 419 424 420 425 ULONG state; 421 426 HRGN hWindowRegion; 422 427 HRGN hClipRegion; 428 HRGN hUpdateRegion; 423 429 424 430 DWORD dwThreadId; //id of thread that created this window
Note:
See TracChangeset
for help on using the changeset viewer.