widget: Untagle if statements

Reduces the number of nested ifs and makes the code clearer.
This commit is contained in:
Benjamin Otte
2014-05-19 04:24:10 +02:00
parent 34a87ee2f3
commit d260694a37

View File

@ -5654,9 +5654,9 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
/* Size allocation is god... after consulting god, no further requests or allocations are needed */
priv->alloc_needed = FALSE;
if (gtk_widget_get_mapped (widget))
if (gtk_widget_get_mapped (widget) && priv->redraw_on_alloc)
{
if (!gtk_widget_get_has_window (widget) && priv->redraw_on_alloc && position_changed)
if (!gtk_widget_get_has_window (widget) && position_changed)
{
/* Invalidate union(old_allaction,priv->allocation) in priv->window
*/
@ -5668,8 +5668,6 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
}
if (size_changed || baseline_changed)
{
if (priv->redraw_on_alloc)
{
/* Invalidate union(old_allaction,priv->allocation) in priv->window and descendents owned by widget
*/
@ -5680,7 +5678,6 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
cairo_region_destroy (invalidate);
}
}
}
if ((size_changed || position_changed || baseline_changed) && priv->parent &&
gtk_widget_get_realized (priv->parent) && _gtk_container_get_reallocate_redraws (GTK_CONTAINER (priv->parent)))