diff options
author | Quentin Glidic <sardemff7+git@sardemff7.net> | 2017-03-21 20:17:23 +0100 |
---|---|---|
committer | Quentin Glidic <sardemff7+git@sardemff7.net> | 2017-03-21 20:17:23 +0100 |
commit | 7632b4bc331646fcf0a9765f1804c2b5a6a95576 (patch) | |
tree | b5d81d35197e0735d74fd55fd10f7f39b4dc7609 /source | |
parent | c992c2fbe661c2a5764c52cb20ef107ee3d609f9 (diff) |
xcb: Quit on outside click
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Diffstat (limited to 'source')
-rw-r--r-- | source/view.c | 6 | ||||
-rw-r--r-- | source/xcb.c | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/source/view.c b/source/view.c index ad54d5be..db10730a 100644 --- a/source/view.c +++ b/source/view.c @@ -306,6 +306,12 @@ void rofi_view_restart ( RofiViewState *state ) state->retv = MENU_CANCEL; } +void rofi_view_quit ( RofiViewState *state ) +{ + state->quit = TRUE; + state->retv = MENU_CANCEL; +} + RofiViewState * rofi_view_get_active ( void ) { return current_active_menu; diff --git a/source/xcb.c b/source/xcb.c index 8bf65229..305006af 100644 --- a/source/xcb.c +++ b/source/xcb.c @@ -272,19 +272,20 @@ static gboolean xcb_callback(xcb_generic_event_t *ev, G_GNUC_UNUSED gpointer use break; } case XCB_BUTTON_RELEASE: - /* FIXME: handle this + { + /* FIXME: add config back if ( config.click_to_exit == TRUE ) { - if ( ( CacheState.flags & MENU_NORMAL_WINDOW ) == 0 ) { + if ( ( CacheState.flags & MENU_NORMAL_WINDOW ) == 0 ) */ { xcb_button_release_event_t *bre = (xcb_button_release_event_t *) ev; - if ( ( state->mouse_seen == FALSE ) && ( bre->event != CacheState.main_window ) ) { - state->quit = TRUE; - state->retv = MENU_CANCEL; + if ( /*( state->mouse_seen == FALSE ) && */( bre->event != xcb->main_window ) ) { + rofi_view_quit(state); } } - state->mouse_seen = FALSE; + /* } */ break; + } // Paste event. case XCB_SELECTION_NOTIFY: //FIXME: rofi_view_paste ( state, (xcb_selection_notify_event_t *) ev ); |