From 8d1075eb2cd002a16ad94db741522e6ecdc29a82 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Sat, 25 Apr 2020 12:09:17 -0400 Subject: [PATCH] Use the browse selection mode to ensure there is alway an item selected. It was possible to deselect items when using a touch screen. This is done by tapping on an item that's already selected. This would cause a segfault in the select_item() function of src/wofi.c since gtk_flow_box_get_selected_children() would return NULL in this case. By setting the selection mode to GTK_SELECTION_BROWSE, we avoid this case by ensuring an item is always selected. --- src/wofi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wofi.c b/src/wofi.c index 1faf847..9896368 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -1608,6 +1608,7 @@ void wofi_init(struct map* _config) { } inner_box = gtk_flow_box_new(); + gtk_flow_box_set_selection_mode(GTK_FLOW_BOX(inner_box), GTK_SELECTION_BROWSE); gtk_flow_box_set_max_children_per_line(GTK_FLOW_BOX(inner_box), columns); gtk_orientable_set_orientation(GTK_ORIENTABLE(inner_box), orientation); gtk_widget_set_halign(inner_box, halign);