Listview X1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This one unfortunately triggers a refresh bug in the
scrollbar's code. Oh, well. It made me loose at least
2-3h, 'cause I thought it was _my_ problem :/

ChangeLog
  Do not do screen work if refreshing is disabled
  Reimplement SetRedraw to cope with the changes.

--- dlls/comctl32/listview.c.X0	Wed Oct 23 23:56:23 2002
+++ dlls/comctl32/listview.c	Thu Oct 24 00:11:14 2002
@@ -1459,7 +1459,7 @@
     SCROLLINFO horzInfo, vertInfo;
 
     if (infoPtr->dwStyle & LVS_NOSCROLL) return;
-    /*if (!is_redrawing(infoPtr)) return;*/
+    if (!is_redrawing(infoPtr)) return;
 
     ZeroMemory(&horzInfo, sizeof(SCROLLINFO));
     horzInfo.cbSize = sizeof(SCROLLINFO);
@@ -3915,7 +3915,7 @@
     }
 
     /* do not update screen if not in report mode */
-    if ((infoPtr->dwStyle & LVS_TYPEMASK) != LVS_REPORT) return;
+    if (!is_redrawing(infoPtr) || (infoPtr->dwStyle & LVS_TYPEMASK) != LVS_REPORT) return;
     
     /* if we have a focus, must first erase the focus rect */
     if (infoPtr->bFocus) LISTVIEW_ShowFocusRect(infoPtr, FALSE);
@@ -4029,7 +4029,7 @@
     POINT Origin;
 
     /* if we don't refresh, what's the point of scrolling? */
-    /*if (!is_redrawing(infoPtr)) return;*/
+    if (!is_redrawing(infoPtr)) return;
     
     assert (abs(dir) == 1);
 
@@ -7681,6 +7681,7 @@
 	UINT uView =  infoPtr->dwStyle & LVS_TYPEMASK;
 	
 	infoPtr->bFirstPaint = FALSE;
+	LISTVIEW_UpdateSize(infoPtr);
 	LISTVIEW_UpdateItemSize(infoPtr);
 	if (uView == LVS_ICON || uView == LVS_SMALLICON)
 	    LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
@@ -7930,10 +7931,18 @@
  */
 static LRESULT LISTVIEW_SetRedraw(LISTVIEW_INFO *infoPtr, BOOL bRedraw)
 {
+    UINT uView =  infoPtr->dwStyle & LVS_TYPEMASK;
+    
     infoPtr->bRedraw = bRedraw;
-    if(bRedraw)
-        RedrawWindow(infoPtr->hwndSelf, NULL, 0,
-            RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ALLCHILDREN | RDW_ERASENOW);
+
+    if(!bRedraw) return 0;
+    
+    LISTVIEW_UpdateSize(infoPtr);
+    if (uView == LVS_ICON || uView == LVS_SMALLICON)
+	LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
+    LISTVIEW_UpdateScroll(infoPtr);
+    LISTVIEW_InvalidateList(infoPtr);
+
     return 0;
 }
 
@@ -7956,6 +7965,8 @@
 
     TRACE("(width=%d, height=%d)\n", Width, Height);
 
+    if (!is_redrawing(infoPtr)) return 0;
+    
     if (!LISTVIEW_UpdateSize(infoPtr)) return 0;
     
     if ((infoPtr->dwStyle & LVS_AUTOARRANGE) && (uView == LVS_SMALLICON || uView == LVS_ICON))
@@ -8589,9 +8600,11 @@
       return LISTVIEW_MouseWheel(infoPtr, (short int)HIWORD(wParam));
 
   case WM_WINDOWPOSCHANGED:
-      if (!(((WINDOWPOS *)lParam)->flags & SWP_NOSIZE)) {
+      if (!(((WINDOWPOS *)lParam)->flags & SWP_NOSIZE)) 
+      {
 	  SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE |
 		       SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
+	  /* FIXME: why do we need this here? */
 	  LISTVIEW_UpdateSize(infoPtr);
 	  LISTVIEW_UpdateScroll(infoPtr);
       }


-- 
Dimi.



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux