[PATCH v5 2/9] comctl32/listbox: Repaint the old selected item after setting the item selection

Gabriel Iv─âncescu gabrielopcode at gmail.com
Wed Feb 13 08:36:13 CST 2019


Signed-off-by: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
---

Single-selection listboxes will rely on this after the next patch to get
correct state when painting. This has been split.

 dlls/comctl32/listbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index db7d474..6ab224e 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -1466,8 +1466,8 @@ static LRESULT LISTBOX_SetSelection( LB_DESCR *descr, INT index,
         if (index == oldsel) return LB_OKAY;
         if (oldsel != -1) descr->items[oldsel].selected = FALSE;
         if (index != -1) descr->items[index].selected = TRUE;
-        if (oldsel != -1) LISTBOX_RepaintItem( descr, oldsel, ODA_SELECT );
         descr->selected_item = index;
+        if (oldsel != -1) LISTBOX_RepaintItem( descr, oldsel, ODA_SELECT );
         if (index != -1) LISTBOX_RepaintItem( descr, index, ODA_SELECT );
         if (send_notify && descr->nb_items) SEND_NOTIFICATION( descr,
                                (index != -1) ? LBN_SELCHANGE : LBN_SELCANCEL );
-- 
2.20.1




More information about the wine-devel mailing list