[gtk/wip/baedert/for-master: 69/69] widget: Compare proper adjusted size to new size when allocating
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 69/69] widget: Compare proper adjusted size to new size when allocating
- Date: Wed, 22 Jul 2020 06:43:41 +0000 (UTC)
commit 895f5de410d539e994fda0ea34e98cda686b0227
Author: Timm Bäder <mail baedert org>
Date: Wed Jul 22 07:10:59 2020 +0200
widget: Compare proper adjusted size to new size when allocating
We were comparing first but then still modifying the adjusted size later
on, leading to unnecessary resizes.
gtk/gtkwidget.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 06f95b3e86..9f64f41448 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3839,7 +3839,6 @@ gtk_widget_allocate (GtkWidget *widget,
gtk_widget_adjust_size_allocation (widget, &adjusted);
- size_changed = (priv->width != adjusted.width) || (priv->height != adjusted.height);
if (adjusted.width < 0 || adjusted.height < 0)
{
@@ -3890,15 +3889,16 @@ gtk_widget_allocate (GtkWidget *widget,
if (priv->surface_transform_data)
sync_widget_surface_transform (widget);
- if (!alloc_needed && !size_changed && !baseline_changed)
- goto skip_allocate;
-
/* Since gtk_widget_measure does it for us, we can be sure here that
* the given alloaction is large enough for the css margin/bordder/padding */
adjusted.width -= border.left + padding.left +
border.right + padding.right;
adjusted.height -= border.top + padding.top +
border.bottom + padding.bottom;
+ size_changed = (priv->width != adjusted.width) || (priv->height != adjusted.height);
+
+ if (!alloc_needed && !size_changed && !baseline_changed)
+ goto skip_allocate;
priv->width = adjusted.width;
priv->height = adjusted.height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]