Back to hacking (partially). Should fix the 'jumping selection' bug: http://bugs.winehq.org/show_bug.cgi?id=1108 ChangeLog Fix the 'jumping selection' bug (#1108) Misc small cleanups. Index: dlls/comctl32/listview.c =================================================================== RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.327 diff -u -r1.327 listview.c --- dlls/comctl32/listview.c 31 Oct 2002 22:01:33 -0000 1.327 +++ dlls/comctl32/listview.c 6 Nov 2002 02:07:30 -0000 @@ -2984,7 +2984,7 @@ LISTVIEW_SetSelection(infoPtr, nItem); } } - ListView_EnsureVisible(infoPtr->hwndSelf, nItem, FALSE); + LISTVIEW_EnsureVisible(infoPtr, nItem, FALSE); } UpdateWindow(infoPtr->hwndSelf); /* update client area */ @@ -3088,6 +3088,7 @@ */ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL isNew, BOOL isW, BOOL *bChanged) { + UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; ITEM_INFO *lpItem; NMLISTVIEW nmlv; UINT uChanged = 0; @@ -3190,7 +3191,7 @@ { LISTVIEW_SetItemFocus(infoPtr, -1); infoPtr->nFocusedItem = lpLVItem->iItem; - LISTVIEW_EnsureVisible(infoPtr, lpLVItem->iItem, FALSE); + LISTVIEW_EnsureVisible(infoPtr, lpLVItem->iItem, uView == LVS_LIST); } else if (infoPtr->nFocusedItem == lpLVItem->iItem) infoPtr->nFocusedItem = -1; @@ -8126,6 +8127,8 @@ { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; + TRACE("uView=%d, rcList(old)=%s\n", uView, debugrect(&infoPtr->rcList)); + GetClientRect(infoPtr->hwndSelf, &infoPtr->rcList); if (uView == LVS_LIST) @@ -8141,7 +8144,7 @@ infoPtr->rcList.bottom -= GetSystemMetrics(SM_CYHSCROLL); infoPtr->rcList.bottom = max (infoPtr->rcList.bottom - 2, 0); } - else if (uView == LVS_REPORT) + else if (uView == LVS_REPORT && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) { HDLAYOUT hl; WINDOWPOS wp; @@ -8152,9 +8155,10 @@ SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy, wp.flags); - if (!(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) - infoPtr->rcList.top = max(wp.cy, 0); + infoPtr->rcList.top = max(wp.cy, 0); } + + TRACE(" rcList=%s\n", debugrect(&infoPtr->rcList)); } /*** @@ -8233,7 +8237,7 @@ } if (uNewView == LVS_REPORT) - ShowWindow(infoPtr->hwndHeader, (LVS_NOCOLUMNHEADER & lpss->styleNew) ? SW_HIDE : SW_SHOWNORMAL); + ShowWindow(infoPtr->hwndHeader, (lpss->styleNew & LVS_NOCOLUMNHEADER) ? SW_HIDE : SW_SHOWNORMAL); if ( (uNewView == LVS_ICON || uNewView == LVS_SMALLICON) && (uNewView != uOldView || ((lpss->styleNew ^ lpss->styleOld) & LVS_ALIGNMASK)) ) -- Dimi.