# HG changeset patch # User Scoopta # Date 1710891752 25200 # Tue Mar 19 16:42:32 2024 -0700 # Node ID a08c4582e01093ac102be1ae21502d5b85ef1087 # Parent 60d680e5a92c512f1a998b0145d081c016dd4f45 Fixed #216 arrow key issue. This was caused by the fix to #184. Both issues should now be resolved diff --git a/src/wofi.c b/src/wofi.c --- a/src/wofi.c +++ b/src/wofi.c @@ -1130,8 +1130,8 @@ return sort_for_matching_mode(text1, text2, fallback, matching, filter, insensitive); } -static void select_first(void) { - GtkFlowBoxChild* child = gtk_flow_box_get_child_at_index(GTK_FLOW_BOX(inner_box), 0); +static void select_idx(gint idx) { + GtkFlowBoxChild* child = gtk_flow_box_get_child_at_index(GTK_FLOW_BOX(inner_box), idx); gtk_widget_grab_focus(GTK_WIDGET(child)); gtk_flow_box_select_child(GTK_FLOW_BOX(inner_box), GTK_FLOW_BOX_CHILD(child)); } @@ -1184,7 +1184,7 @@ user_moved = true; if(outer_orientation == GTK_ORIENTATION_VERTICAL) { if(gtk_widget_has_focus(entry) || gtk_widget_has_focus(scroll)) { - select_first(); + select_idx(1); return; } } @@ -1200,7 +1200,7 @@ user_moved = true; if(outer_orientation == GTK_ORIENTATION_HORIZONTAL) { if(gtk_widget_has_focus(entry) || gtk_widget_has_focus(scroll)) { - select_first(); + select_idx(1); return; } } @@ -1210,14 +1210,14 @@ static void move_forward(void) { user_moved = true; if(gtk_widget_has_focus(entry) || gtk_widget_has_focus(scroll)) { - select_first(); + select_idx(1); return; } gtk_widget_child_focus(window, GTK_DIR_TAB_FORWARD); if(gtk_widget_has_focus(entry)) { - select_first(); + select_idx(0); } }