[gtk/constraint-grid] Freeze when measuring and allocating
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/constraint-grid] Freeze when measuring and allocating
- Date: Thu, 27 Jun 2019 04:34:07 +0000 (UTC)
commit 3dc50c1e628c8000fbf54c2cad53ade6c904e087
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jun 27 04:10:31 2019 +0000
Freeze when measuring and allocating
We are doing quite a number of constraints
changes here, and don't need to optimize
after each one.
gtk/gtkconstraintlayout.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/gtk/gtkconstraintlayout.c b/gtk/gtkconstraintlayout.c
index f9cb726b8e..14b8fa6e80 100644
--- a/gtk/gtkconstraintlayout.c
+++ b/gtk/gtkconstraintlayout.c
@@ -696,6 +696,8 @@ gtk_constraint_layout_measure (GtkLayoutManager *manager,
if (solver == NULL)
return;
+ gtk_constraint_solver_freeze (solver);
+
/* We measure each child in the layout and impose restrictions on the
* minimum and natural size, so we can solve the size of the overall
* layout later on
@@ -772,6 +774,8 @@ gtk_constraint_layout_measure (GtkLayoutManager *manager,
}
}
+ gtk_constraint_solver_thaw (solver);
+
switch (orientation)
{
case GTK_ORIENTATION_HORIZONTAL:
@@ -844,6 +848,8 @@ gtk_constraint_layout_allocate (GtkLayoutManager *manager,
if (solver == NULL)
return;
+ gtk_constraint_solver_freeze (solver);
+
/* We add required stay constraints to ensure that the layout remains
* within the bounds of the allocation
*/
@@ -939,6 +945,8 @@ gtk_constraint_layout_allocate (GtkLayoutManager *manager,
GTK_CONSTRAINT_WEIGHT_MEDIUM);
}
+ gtk_constraint_solver_thaw (solver);
+
for (child = _gtk_widget_get_first_child (widget);
child != NULL;
child = _gtk_widget_get_next_sibling (child))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]