mirror of https://github.com/davatorium/rofi.git
Issue: #38 remove delay (until next blink) when triggering on release (version 2.0)
This commit is contained in:
parent
c9b5667a3f
commit
3f88ef0032
|
@ -478,6 +478,20 @@ static inline void load_configuration_dynamic ( )
|
||||||
/**
|
/**
|
||||||
* Process X11 events in the main-loop (gui-thread) of the application.
|
* Process X11 events in the main-loop (gui-thread) of the application.
|
||||||
*/
|
*/
|
||||||
|
static void main_loop_x11_event_handler_view ( xcb_generic_event_t *ev){
|
||||||
|
RofiViewState *state = rofi_view_get_active ();
|
||||||
|
if ( state != NULL ) {
|
||||||
|
rofi_view_itterrate ( state, ev, &xkb );
|
||||||
|
if ( rofi_view_get_completed ( state ) ) {
|
||||||
|
// This menu is done.
|
||||||
|
rofi_view_finalize ( state );
|
||||||
|
// cleanup
|
||||||
|
if ( rofi_view_get_active () == NULL ) {
|
||||||
|
g_main_loop_quit ( main_loop );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UNUSED gpointer data )
|
static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UNUSED gpointer data )
|
||||||
{
|
{
|
||||||
if ( ev == NULL ) {
|
if ( ev == NULL ) {
|
||||||
|
@ -510,39 +524,22 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN
|
||||||
modmask = x11_get_current_mask ( &xkb );
|
modmask = x11_get_current_mask ( &xkb );
|
||||||
if ( modmask == 0 ) {
|
if ( modmask == 0 ) {
|
||||||
abe_trigger_release ( );
|
abe_trigger_release ( );
|
||||||
|
|
||||||
// Because of abe_trigger, state of rofi can be changed. handle this!
|
// Because of abe_trigger, state of rofi can be changed. handle this!
|
||||||
RofiViewState *state = rofi_view_get_active ();
|
// Run mainloop on dummy event.
|
||||||
if ( state != NULL ) {
|
xcb_generic_event_t dev = {0,};
|
||||||
if ( rofi_view_get_completed ( state ) ) {
|
dev.response_type = 0;
|
||||||
// This menu is done.
|
main_loop_x11_event_handler_view ( &dev );
|
||||||
rofi_view_finalize ( state );
|
|
||||||
// cleanup
|
|
||||||
if ( rofi_view_get_active () == NULL ) {
|
|
||||||
g_main_loop_quit ( main_loop );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return G_SOURCE_CONTINUE;
|
return G_SOURCE_CONTINUE;
|
||||||
}
|
}
|
||||||
RofiViewState *state = rofi_view_get_active ();
|
|
||||||
if ( xcb->sndisplay != NULL ) {
|
if ( xcb->sndisplay != NULL ) {
|
||||||
sn_xcb_display_process_event ( xcb->sndisplay, ev );
|
sn_xcb_display_process_event ( xcb->sndisplay, ev );
|
||||||
}
|
}
|
||||||
if ( state != NULL ) {
|
main_loop_x11_event_handler_view ( ev );
|
||||||
rofi_view_itterrate ( state, ev, &xkb );
|
|
||||||
if ( rofi_view_get_completed ( state ) ) {
|
|
||||||
// This menu is done.
|
|
||||||
rofi_view_finalize ( state );
|
|
||||||
// cleanup
|
|
||||||
if ( rofi_view_get_active () == NULL ) {
|
|
||||||
g_main_loop_quit ( main_loop );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return G_SOURCE_CONTINUE;
|
return G_SOURCE_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue