# HG changeset patch # User Olaf Wintermann # Date 1756541889 -7200 # Node ID ac7f0869e8ae10f54bccce90dc0b499d9e4bb6ef # Parent 3ad4792ffadcffe5ef0981a33e689e23e7403a42 extend ui_list_setselection to allow to remove selections diff -r 3ad4792ffadc -r ac7f0869e8ae ui/common/types.c --- a/ui/common/types.c Sat Aug 30 10:14:46 2025 +0200 +++ b/ui/common/types.c Sat Aug 30 10:18:09 2025 +0200 @@ -627,10 +627,12 @@ } UIEXPORT void ui_list_setselection(UiList *list, int index) { - if (list->setselection && index >= 0) { - UiListSelection sel; - sel.count = 1; - sel.rows = &index; + if (list->setselection) { + UiListSelection sel = { 0, NULL }; + if(index >= 0) { + sel.count = 1; + sel.rows = &index; + } list->setselection(list, sel); } }