Added the single_click config option
2 files changed, 7 insertions(+), 3 deletions(-)

M man/wofi.5
M src/wofi.c
M man/wofi.5 +3 -0
@@ 186,6 186,9 @@ Specifies the layer to open on. The opti
 .B copy_exec=\fIPATH\fR
 Specifies the executable to pipe copy data into. $PATH will be scanned, this is not passed to a shell and must be an executable. Default is wl-copy.
+.B single_click=\fIBOOL\fR
+Specifies whether or not actions should be executed on a single click or a double click. Default is false.
 Any GTK widget can be selected by using the name of its CSS node, these however might change with updates and are not guaranteed to stay constant. Wofi also provides certain widgets with names and classes which can be referenced from CSS to give access to the most important widgets easily. \fBwofi\fR(7) contains the current widget layout used by wofi so if you want to get into CSS directly using GTK widget names look there for info.

M src/wofi.c +4 -3
@@ 105,6 105,7 @@ static pthread_t mode_thread;
 static bool has_joined_mode = false;
 static char* copy_exec = NULL;
 static char* pre_display_cmd = NULL;
+static bool single_click = false;
 static struct map* keys;

@@ 583,7 584,7 @@ static gboolean _insert_widget(gpointer 
 		gtk_expander_set_label_widget(GTK_EXPANDER(parent), box);
 		GtkWidget* exp_box = gtk_list_box_new();
-		gtk_list_box_set_activate_on_single_click(GTK_LIST_BOX(exp_box), FALSE);
+		gtk_list_box_set_activate_on_single_click(GTK_LIST_BOX(exp_box), single_click);
 		g_signal_connect(exp_box, "row-activated", G_CALLBACK(activate_item), NULL);
 		gtk_container_add(GTK_CONTAINER(parent), exp_box);
 		for(size_t count = 1; count < node->action_count; ++count) {

@@ 1620,8 1621,8 @@ void wofi_init(struct map* _config) {
 	char* monitor = map_get(config, "monitor");
 	char* layer = config_get(config, "layer", "top");
 	copy_exec = config_get(config, "copy_exec", "wl-copy");
 	pre_display_cmd = map_get(config, "pre_display_cmd");
+	single_click = strcmp(config_get(config, "single_click", "false"), "true") == 0;
 	keys = map_init_void();

@@ 1792,7 1793,7 @@ void wofi_init(struct map* _config) {
 	gtk_widget_set_valign(inner_box, valign);
 	gtk_widget_set_name(inner_box, "inner-box");
-	gtk_flow_box_set_activate_on_single_click(GTK_FLOW_BOX(inner_box), FALSE);
+	gtk_flow_box_set_activate_on_single_click(GTK_FLOW_BOX(inner_box), single_click);
 	GtkWidget* wrapper_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_box_set_homogeneous(GTK_BOX(wrapper_box), TRUE);