mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 22:30:22 +00:00
widget: Optimize away unndeeded redraws
If only styles were updated that don't require resizes, don't queue one.
This commit is contained in:
parent
8560ff88cd
commit
35362337ec
@ -35,6 +35,7 @@
|
|||||||
#include "gtkcontainer.h"
|
#include "gtkcontainer.h"
|
||||||
#include "gtkaccelmapprivate.h"
|
#include "gtkaccelmapprivate.h"
|
||||||
#include "gtkclipboard.h"
|
#include "gtkclipboard.h"
|
||||||
|
#include "gtkcssstylepropertyprivate.h"
|
||||||
#include "gtkiconfactory.h"
|
#include "gtkiconfactory.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
@ -6716,15 +6717,27 @@ gtk_widget_real_style_updated (GtkWidget *widget)
|
|||||||
|
|
||||||
if (widget->priv->context)
|
if (widget->priv->context)
|
||||||
{
|
{
|
||||||
|
const GtkBitmask *changes = _gtk_style_context_get_changes (widget->priv->context);
|
||||||
|
|
||||||
if (gtk_widget_get_realized (widget) &&
|
if (gtk_widget_get_realized (widget) &&
|
||||||
gtk_widget_get_has_window (widget) &&
|
gtk_widget_get_has_window (widget) &&
|
||||||
!gtk_widget_get_app_paintable (widget))
|
!gtk_widget_get_app_paintable (widget))
|
||||||
gtk_style_context_set_background (widget->priv->context,
|
gtk_style_context_set_background (widget->priv->context,
|
||||||
widget->priv->window);
|
widget->priv->window);
|
||||||
}
|
|
||||||
|
|
||||||
if (widget->priv->anchored)
|
if (widget->priv->anchored)
|
||||||
gtk_widget_queue_resize (widget);
|
{
|
||||||
|
if (changes && _gtk_css_style_property_changes_affect_size (changes))
|
||||||
|
gtk_widget_queue_resize (widget);
|
||||||
|
else
|
||||||
|
gtk_widget_queue_draw (widget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (widget->priv->anchored)
|
||||||
|
gtk_widget_queue_resize (widget);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user