2017-05-02 23:10 GMT-06:00 Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>:
Hi Alex,
On 03/05/17 14:53, Alex Henrie wrote:
Cc: Nikolay Sivov <nsivov(a)codeweavers.com>
+static void LISTVIEW_UpdateScroll(LISTVIEW_INFO *infoPtr) +{ + INT dx, dy; + + if ((infoPtr->dwStyle & LVS_NOSCROLL) || !is_redrawing(infoPtr)) return; + + /* Setting the horizontal scroll can change the listview size + * (and potentially everything else) so we need to recompute + * everything again for the vertical scroll and vice-versa + */ + + dx = LISTVIEW_UpdateHScroll(infoPtr); + dy = LISTVIEW_UpdateVScroll(infoPtr); + dx += LISTVIEW_UpdateHScroll(infoPtr); + dy += LISTVIEW_UpdateVScroll(infoPtr); + Is there any reason your calling update twice for each control?
For example: 1. Because of new content, a horizontal scrollbar is added, taking up some of the vertical space (dx = LISTVIEW_UpdateHScroll(infoPtr)) 2. Because there is not enough vertical space now, a vertical scrollbar is added, taking up some of the horizontal space (dy = LISTVIEW_UpdateVScroll(infoPtr)) 3. The horizontal scrollbar thumb's position is updated to reflect that there is less horizontal space now (dx += LISTVIEW_UpdateHScroll(infoPtr)) Or: 1. Because of new content, a vertical scrollbar is added, taking up some of the horizontal space (dy = LISTVIEW_UpdateVScroll(infoPtr)) 2. Because there is not enough horizontal space now, a horizontal scrollbar is added, taking up some of the vertical space (dx += LISTVIEW_UpdateHScroll(infoPtr)) 3. The vertical scrollbar thumb's position is updated to reflect that there is less vertical space now (dy += LISTVIEW_UpdateVScroll(infoPtr)) -Alex