diff options
Diffstat (limited to 'source/view.c')
-rw-r--r-- | source/view.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/view.c b/source/view.c index 44ce9328..5ba1309a 100644 --- a/source/view.c +++ b/source/view.c @@ -415,6 +415,9 @@ static void rofi_view_calculate_window_position ( RofiViewState *state ) static void rofi_view_window_update_size ( RofiViewState * state ) { + if ( state == NULL ) { + return; + } uint16_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; uint32_t vals[] = { state->x, state->y, state->width, state->height }; @@ -490,6 +493,15 @@ RofiViewState * rofi_view_get_active ( void ) return current_active_menu; } +void rofi_view_remove_active ( RofiViewState *state ) +{ + if ( state == current_active_menu ) { + rofi_view_set_active ( NULL ); + } + else if ( state ) { + g_queue_remove ( &(CacheState.views ), state); + } +} void rofi_view_set_active ( RofiViewState *state ) { if ( current_active_menu != NULL && state != NULL ) { |