[PATCH] Use the browse selection mode to ensure there is alway an item selected

Brian Daniels
Message ID
DKIM signature
Download raw message
# HG changeset patch
# User Brian Daniels <brianddaniels@gmail.com>
# Date 1587830957 14400
#      Sat Apr 25 12:09:17 2020 -0400
# Node ID 71ee23539399a8b08033a7fdbd5aae2550c9c127
# Parent  c7a4b676a9921bdbc810a590e3abbd3d2a7b3e23
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.

diff -r c7a4b676a992 -r 71ee23539399 src/wofi.c
--- a/src/wofi.c	Fri Apr 24 22:41:49 2020 -0700
+++ b/src/wofi.c	Sat Apr 25 12:09:17 2020 -0400
@@ -1608,6 +1608,7 @@
 	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);
Message ID
<71ee23539399a8b08033.1587831001@brianlaptop> (view parent)
DKIM signature
Download raw message
DKIM signature: fail
Thanks, pushed.
Reply to thread Export thread (mbox)