mirror of
https://github.com/lbonn/rofi
synced 2024-11-27 06:10:30 +00:00
Don't draw widget when size is 0 or less.
This commit is contained in:
parent
8f6a323ed6
commit
8bbf1b36d5
2 changed files with 6 additions and 0 deletions
|
@ -797,6 +797,7 @@ void rofi_view_update ( RofiViewState *state, gboolean qr )
|
|||
if ( !widget_need_redraw ( WIDGET ( state->main_window ) ) && !widget_need_redraw ( WIDGET ( state->overlay ) ) ) {
|
||||
return;
|
||||
}
|
||||
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Redraw view" );
|
||||
TICK ();
|
||||
cairo_t *d = CacheState.edit_draw;
|
||||
cairo_set_operator ( d, CAIRO_OPERATOR_SOURCE );
|
||||
|
|
|
@ -88,6 +88,11 @@ void widget_draw ( widget *widget, cairo_t *d )
|
|||
{
|
||||
// Check if enabled and if draw is implemented.
|
||||
if ( widget && widget->enabled && widget->draw ) {
|
||||
// Don't draw if there is no space.
|
||||
if ( widget->h < 1 || widget->w < 1 ){
|
||||
widget->need_redraw = FALSE;
|
||||
return;
|
||||
}
|
||||
// Store current state.
|
||||
cairo_save ( d );
|
||||
int margin_left = distance_get_pixel ( widget->margin.left, ORIENTATION_HORIZONTAL );
|
||||
|
|
Loading…
Reference in a new issue