1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-03 04:23:42 -05:00

Give overlay widget a parent, queue widget redraw on enable/disable

This commit is contained in:
Dave Davenport 2017-01-31 08:09:55 +01:00
parent 714b5968d5
commit 954288ab81
3 changed files with 5 additions and 1 deletions

View file

@ -158,6 +158,7 @@ static void async_read_callback ( GObject *source_object, GAsyncResult *res, gpo
} }
if ( !g_cancellable_is_cancelled ( pd->cancel ) ) { if ( !g_cancellable_is_cancelled ( pd->cancel ) ) {
// Hack, don't use get active. // Hack, don't use get active.
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Clearing overlay");
rofi_view_set_overlay ( rofi_view_get_active (), NULL ); rofi_view_set_overlay ( rofi_view_get_active (), NULL );
g_input_stream_close_async ( G_INPUT_STREAM ( stream ), G_PRIORITY_LOW, pd->cancel, async_close_callback, pd ); g_input_stream_close_async ( G_INPUT_STREAM ( stream ), G_PRIORITY_LOW, pd->cancel, async_close_callback, pd );
} }

View file

@ -877,7 +877,7 @@ static void update_callback ( textbox *t, unsigned int index, void *udata, TextB
void rofi_view_update ( RofiViewState *state, gboolean qr ) void rofi_view_update ( RofiViewState *state, gboolean qr )
{ {
if ( !widget_need_redraw ( WIDGET ( state->main_window ) ) && !widget_need_redraw ( WIDGET ( state->overlay ) ) ) { if ( !widget_need_redraw ( WIDGET ( state->main_window ) ) ) {
return; return;
} }
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Redraw view" ); g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Redraw view" );
@ -1585,6 +1585,7 @@ RofiViewState *rofi_view_create ( Mode *sw,
} }
state->overlay = textbox_create ( "window.overlay", TB_AUTOWIDTH | TB_AUTOHEIGHT, URGENT, "blaat" ); state->overlay = textbox_create ( "window.overlay", TB_AUTOWIDTH | TB_AUTOHEIGHT, URGENT, "blaat" );
state->overlay->widget.parent = WIDGET(state->main_window);
widget_disable ( WIDGET ( state->overlay ) ); widget_disable ( WIDGET ( state->overlay ) );
state->list_view = listview_create ( "window.mainbox.listview", update_callback, state, config.element_height, end ); state->list_view = listview_create ( "window.mainbox.listview", update_callback, state, config.element_height, end );

View file

@ -81,6 +81,7 @@ void widget_enable ( widget *widget )
widget->enabled = TRUE; widget->enabled = TRUE;
widget_update ( widget ); widget_update ( widget );
widget_update ( widget->parent ); widget_update ( widget->parent );
widget_queue_redraw ( widget );
} }
} }
void widget_disable ( widget *widget ) void widget_disable ( widget *widget )
@ -89,6 +90,7 @@ void widget_disable ( widget *widget )
widget->enabled = FALSE; widget->enabled = FALSE;
widget_update ( widget ); widget_update ( widget );
widget_update ( widget->parent ); widget_update ( widget->parent );
widget_queue_redraw ( widget );
} }
} }
void widget_draw ( widget *widget, cairo_t *d ) void widget_draw ( widget *widget, cairo_t *d )