Module: wine Branch: oldstable Commit: 813b704ece756dafacc8f018c1615ec8c3dfa63d URL: https://gitlab.winehq.org/wine/wine/-/commit/813b704ece756dafacc8f018c1615ec...
Author: Angelo Haller angelo@szanni.org Date: Tue Jun 28 16:16:07 2022 -0500
comctl32/listview: Send one deselect all items notification for LVS_OWNERDATA listviews.
Send one deselect all items notification on selection change for LVS_OWNERDATA listviews instead of notifying about each individual item change.
Signed-off-by: Angelo Haller angelo@szanni.org (cherry picked from commit 8b392553b32677d25fd3e0fe14f70a5693f3b42c) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/comctl32/listview.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 1b39cf3d41a..5c695c216e5 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -3404,7 +3404,14 @@ static BOOL LISTVIEW_DeselectAllSkipItems(LISTVIEW_INFO *infoPtr, RANGES toSkip)
lvItem.state = 0; lvItem.stateMask = LVIS_SELECTED; - + + /* Only send one deselect all (-1) notification for LVS_OWNERDATA style */ + if (infoPtr->dwStyle & LVS_OWNERDATA) + { + LISTVIEW_SetItemState(infoPtr, -1, &lvItem); + return TRUE; + } + /* need to clone the DPA because callbacks can change it */ if (!(clone = ranges_clone(infoPtr->selectionRanges))) return FALSE; iterator_rangesitems(&i, ranges_diff(clone, toSkip));