Small update trying to fix past commit.

This commit is contained in:
QC 2014-11-29 16:54:42 +01:00
parent 6805d93f68
commit e2a3139b7d
2 changed files with 8 additions and 4 deletions

View File

@ -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;
}

View File

@ -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 ||