mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Give overlay widget a parent, queue widget redraw on enable/disable
This commit is contained in:
parent
714b5968d5
commit
954288ab81
3 changed files with 5 additions and 1 deletions
|
@ -158,6 +158,7 @@ static void async_read_callback ( GObject *source_object, GAsyncResult *res, gpo
|
|||
}
|
||||
if ( !g_cancellable_is_cancelled ( pd->cancel ) ) {
|
||||
// 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 );
|
||||
g_input_stream_close_async ( G_INPUT_STREAM ( stream ), G_PRIORITY_LOW, pd->cancel, async_close_callback, pd );
|
||||
}
|
||||
|
|
|
@ -877,7 +877,7 @@ static void update_callback ( textbox *t, unsigned int index, void *udata, TextB
|
|||
|
||||
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;
|
||||
}
|
||||
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->widget.parent = WIDGET(state->main_window);
|
||||
widget_disable ( WIDGET ( state->overlay ) );
|
||||
|
||||
state->list_view = listview_create ( "window.mainbox.listview", update_callback, state, config.element_height, end );
|
||||
|
|
|
@ -81,6 +81,7 @@ void widget_enable ( widget *widget )
|
|||
widget->enabled = TRUE;
|
||||
widget_update ( widget );
|
||||
widget_update ( widget->parent );
|
||||
widget_queue_redraw ( widget );
|
||||
}
|
||||
}
|
||||
void widget_disable ( widget *widget )
|
||||
|
@ -89,6 +90,7 @@ void widget_disable ( widget *widget )
|
|||
widget->enabled = FALSE;
|
||||
widget_update ( widget );
|
||||
widget_update ( widget->parent );
|
||||
widget_queue_redraw ( widget );
|
||||
}
|
||||
}
|
||||
void widget_draw ( widget *widget, cairo_t *d )
|
||||
|
|
Loading…
Reference in a new issue