diff --git a/AUTHORS b/AUTHORS index c392bcc85..18a5aed0a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,6 +17,7 @@ Deiwin Sarjas Dimitar Yordanov Edwin Pujols eigengrau +Enrico Lamperti Eric Engeström Fangrui Song fice-t diff --git a/doc/rofi-theme.5 b/doc/rofi-theme.5 index 457874fcb..e2040f12f 100644 --- a/doc/rofi-theme.5 +++ b/doc/rofi-theme.5 @@ -1579,8 +1579,7 @@ The order the elements are layed out. Vertical is the original 'column' view. Do not reduce the number of columns shown when number of visible elements is not enough to fill them all. .IP \(bu 2 \fBrequire-input\fP: boolean -Listview requires user input to be unhidden. The list will still respond to normal interaction. -Hitting accept will still activate the selected entry. +Listview requires user input to be unhidden. Hitting accept with no input won't activate any entry. .RE diff --git a/doc/rofi-theme.5.markdown b/doc/rofi-theme.5.markdown index 55af7984e..d7f4dd523 100644 --- a/doc/rofi-theme.5.markdown +++ b/doc/rofi-theme.5.markdown @@ -978,8 +978,7 @@ The following properties are currently supported: * **fixed-columns**: boolean Do not reduce the number of columns shown when number of visible elements is not enough to fill them all. * **require-input**: boolean - Listview requires user input to be unhidden. The list will still respond to normal interaction. - Hitting accept will still activate the selected entry. + Listview requires user input to be unhidden. Hitting accept with no input won't activate any entry. Each element is a `box` called `element`. Each `element` can contain an `element-icon` and `element-text`. diff --git a/source/view.c b/source/view.c index 331b78522..342d1b26c 100644 --- a/source/view.c +++ b/source/view.c @@ -1717,7 +1717,7 @@ static void rofi_view_trigger_global_action(KeyBindingAction action) { } case ACCEPT_ENTRY: { rofi_view_refilter_force(state); - // If a valid item is selected, return that.. + // If a valid item is selected, return that. unsigned int selected = listview_get_selected(state->list_view); state->selected_line = UINT32_MAX; if (selected < state->filtered_lines) { @@ -1728,7 +1728,9 @@ static void rofi_view_trigger_global_action(KeyBindingAction action) { state->retv = MENU_CUSTOM_INPUT; } - state->quit = TRUE; + if (selected != UINT32_MAX) { + state->quit = TRUE; + } break; } } diff --git a/source/widgets/listview.c b/source/widgets/listview.c index 79e818932..1ea54ec93 100644 --- a/source/widgets/listview.c +++ b/source/widgets/listview.c @@ -577,6 +577,9 @@ void listview_set_num_elements(listview *lv, unsigned int rows) { } unsigned int listview_get_selected(listview *lv) { + if (lv->require_input && !lv->filtered) { + return UINT32_MAX; + } if (lv != NULL) { return lv->selected; }