From e2a3139b7dd02021a9ec2d523e436a98ef83c189 Mon Sep 17 00:00:00 2001 From: QC Date: Sat, 29 Nov 2014 16:54:42 +0100 Subject: [PATCH] Small update trying to fix past commit. --- source/rofi.c | 10 +++++++--- source/textbox.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/rofi.c b/source/rofi.c index 5fa89ffc..486eb5e1 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1652,14 +1652,18 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom // If a valid item is selected, return that.. if ( state.selected < state.filtered_lines && state.filtered[state.selected] != NULL ) { *( state.selected_line ) = state.line_map[state.selected]; - if ( strlen( state.text->text ) > 0 && rc == -2 ) { + if ( strlen ( state.text->text ) > 0 && rc == -2 ) { state.retv = MENU_CUSTOM_INPUT; - } else { + } + else { state.retv = MENU_OK; } } - // Nothing entered and nothing selected. + else if ( rc == -2 ) { + state.retv = MENU_CUSTOM_INPUT; + } else{ + // Nothing entered and nothing selected. state.retv = MENU_CANCEL; } diff --git a/source/textbox.c b/source/textbox.c index 5228672f..b8e9777c 100644 --- a/source/textbox.c +++ b/source/textbox.c @@ -405,7 +405,7 @@ int textbox_keypress ( textbox *tb, XEvent *ev ) textbox_cursor_bkspc ( tb ); return 1; } - else if ( ( ev->xkey.state & ControlMask ) && ( key == XK_Return || key == XK_KP_Enter) ) { + else if ( ( ev->xkey.state & ControlMask ) && ( key == XK_Return || key == XK_KP_Enter ) ) { return -2; } else if ( key == XK_Return || key == XK_KP_Enter ||