Only queue redraw when state actually changes

This commit is contained in:
Dave Davenport 2017-01-06 13:26:26 +01:00
parent f45e910a1b
commit 0e037237f8

View file

@ -18,11 +18,13 @@ void widget_init ( widget *widget , const char *name )
void widget_set_state ( widget *widget, const char *state )
{
widget->state = state;
// Update border.
widget->border = rofi_theme_get_padding ( widget, "border", widget->border);
if ( g_strcmp0(widget->state, state ) ){
widget->state = state;
// Update border.
widget->border = rofi_theme_get_padding ( widget, "border", widget->border);
widget->need_redraw = TRUE;
widget_queue_redraw ( widget );
}
}
int widget_intersect ( const widget *widget, int x, int y )