1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-07-31 21:59:25 -04:00

Fix crash on wrongly queued ViewState (thx to teto)

This commit is contained in:
Dave Davenport 2016-11-02 18:20:17 +01:00
parent 95e8268796
commit ed6cb59b5d
5 changed files with 19 additions and 15 deletions

View file

@ -174,6 +174,10 @@ static void run_switcher ( ModeMode mode )
return; return;
} }
} }
// Error dialog must have been created.
if ( rofi_view_get_active () != NULL ) {
return;
}
curr_switcher = mode; curr_switcher = mode;
RofiViewState * state = rofi_view_create ( modi[mode], config.filter, NULL, MENU_NORMAL, process_result ); RofiViewState * state = rofi_view_create ( modi[mode], config.filter, NULL, MENU_NORMAL, process_result );
if ( state ) { if ( state ) {

View file

@ -284,7 +284,7 @@ RofiViewState * rofi_view_get_active ( void )
void rofi_view_set_active ( RofiViewState *state ) void rofi_view_set_active ( RofiViewState *state )
{ {
if ( current_active_menu != NULL && state != NULL ) { if ( current_active_menu != NULL && state != NULL ) {
g_queue_push_head ( &( CacheState.views ), state ); g_queue_push_head ( &( CacheState.views ), current_active_menu );
// TODO check. // TODO check.
current_active_menu = state; current_active_menu = state;
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "stack view." ); g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "stack view." );