summaryrefslogtreecommitdiffstats
path: root/source/view.c
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2016-04-07 14:24:15 +0200
committerQuentin Glidic <sardemff7+git@sardemff7.net>2016-05-07 11:23:44 +0200
commit117c2360a44726ac57fe09ee3502723999f9fe19 (patch)
tree7200af3ff092bcfe4ba380e5ab840e758dad67fe /source/view.c
parent0d899f1bbd265d6300f630d9d9672a06d3192ab6 (diff)
view/keypress: Cleanup some useless stuff
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Diffstat (limited to 'source/view.c')
-rw-r--r--source/view.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/source/view.c b/source/view.c
index 2d751553..18ed4485 100644
--- a/source/view.c
+++ b/source/view.c
@@ -1361,11 +1361,13 @@ static void rofi_view_handle_keypress ( RofiViewState *state, xkb_stuff *xkb, xc
xcb_convert_selection ( xcb->connection, CacheState.main_window, XCB_ATOM_PRIMARY,
xcb->ewmh.UTF8_STRING, xcb->ewmh.UTF8_STRING, XCB_CURRENT_TIME );
xcb_flush ( xcb->connection );
+ return;
}
- else if ( abe_test_action ( PASTE_SECONDARY, modstate, key ) ) {
+ if ( abe_test_action ( PASTE_SECONDARY, modstate, key ) ) {
xcb_convert_selection ( xcb->connection, CacheState.main_window, XCB_ATOM_SECONDARY,
xcb->ewmh.UTF8_STRING, xcb->ewmh.UTF8_STRING, XCB_CURRENT_TIME );
xcb_flush ( xcb->connection );
+ return;
}
if ( abe_test_action ( SCREENSHOT, modstate, key ) ) {
menu_capture_screenshot ( );
@@ -1378,21 +1380,21 @@ static void rofi_view_handle_keypress ( RofiViewState *state, xkb_stuff *xkb, xc
textbox_text ( state->case_indicator, get_matching_state () );
return;
}
- else if ( abe_test_action ( MODE_PREVIOUS, modstate, key ) ) {
+ if ( abe_test_action ( MODE_PREVIOUS, modstate, key ) ) {
state->retv = MENU_PREVIOUS;
( state->selected_line ) = 0;
state->quit = TRUE;
return;
}
// Menu navigation.
- else if ( abe_test_action ( MODE_NEXT, modstate, key ) ) {
+ if ( abe_test_action ( MODE_NEXT, modstate, key ) ) {
state->retv = MENU_NEXT;
( state->selected_line ) = 0;
state->quit = TRUE;
return;
}
// Toggle case sensitivity.
- else if ( abe_test_action ( TOGGLE_CASE_SENSITIVITY, modstate, key ) ) {
+ if ( abe_test_action ( TOGGLE_CASE_SENSITIVITY, modstate, key ) ) {
config.case_sensitive = !config.case_sensitive;
( state->selected_line ) = 0;
state->refilter = TRUE;
@@ -1401,7 +1403,7 @@ static void rofi_view_handle_keypress ( RofiViewState *state, xkb_stuff *xkb, xc
return;
}
// Special delete entry command.
- else if ( abe_test_action ( DELETE_ENTRY, modstate, key ) ) {
+ if ( abe_test_action ( DELETE_ENTRY, modstate, key ) ) {
if ( state->selected < state->filtered_lines ) {
( state->selected_line ) = state->line_map[state->selected];
state->retv = MENU_ENTRY_DELETE;
@@ -1424,11 +1426,6 @@ static void rofi_view_handle_keypress ( RofiViewState *state, xkb_stuff *xkb, xc
return;
}
}
- {
- // Skip if we detected key before.
- if ( state->quit ) {
- return;
- }
int rc = textbox_keypress ( state->text, pad, len, modstate, key );
// Row is accepted.
@@ -1458,7 +1455,6 @@ static void rofi_view_handle_keypress ( RofiViewState *state, xkb_stuff *xkb, xc
// redraw.
state->update = TRUE;
}
- }
}
static void rofi_view_mainloop_iter ( RofiViewState *state, xcb_generic_event_t *ev, xkb_stuff *xkb )