http://bugs.winehq.org/show_bug.cgi?id=58211 --- Comment #7 from Michael <micetym@gmail.com> --- A refinement of the reproduction condition, and a hint at where the bad item comes from. WHAT ACTUALLY MATTERS IS THAT THE LIST OVERFLOWS THE WINDOW Not the number of items as such. A tree short enough to fit in the visible area is fully functional immediately and never crashes. A tree longer than the window is mis-drawn until it is scrolled for the first time: items are painted incompletely and hover highlighting does not work at all. After one scroll the tree becomes fully functional, and clicking is then harmless. So the crash window is "long list, not yet scrolled", which is why a handful of entries never reproduces it and a few hundred does. WHERE THIS SEEMS TO COME FROM TREEVIEW_HitTestPoint() resolves a point purely through the visibility bookkeeping: row = pt.y / infoPtr->uItemHeight + infoPtr->firstVisible->visibleOrder; for (item = infoPtr->firstVisible; item != NULL; item = TREEVIEW_GetNextListItem(infoPtr, item)) { if (row >= item->visibleOrder && row < item->visibleOrder + item->iIntegral) break; } Newly inserted items start with visibleOrder = -1 and only get a real value from TREEVIEW_RecalculateVisibleOrder(), which is among other places called from the scroll handling path. That matches the observed behaviour exactly: before the first scroll the ordering is incomplete, which is both why the control paints and hovers incorrectly and why the hit test can hand back an item that TREEVIEW_ValidItem() subsequently rejects. I have not proven which of the two is the primary path - the NM_CLICK re-entrancy described earlier, or stale visibility bookkeeping - and they may well combine. But the guard proposed earlier is valid in either case, since it simply refuses to pass an item that TREEVIEW_ValidItem() does not accept, exactly as TREEVIEW_SelectItem() already does. Reproducing: use a tree with more entries than fit on screen, and click before scrolling. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.