summaryrefslogtreecommitdiff
path: root/gtk/gtkroot.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2019-04-09 14:20:54 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2019-06-30 23:42:44 +0100
commit98a21bf498f2894778b26542c9f3c36a76485620 (patch)
tree9736635a704601709f0ee8d508030f7a95a45f9f /gtk/gtkroot.c
parentc694dd6049aa59ad0f497092479970cf4948cc2a (diff)
downloadgtk+-98a21bf498f2894778b26542c9f3c36a76485620.tar.gz
Assign a GtkConstraintSolver to each GtkRoot
Constraints need to work across different parents, so it's better to have a single constraint solver per top level.
Diffstat (limited to 'gtk/gtkroot.c')
-rw-r--r--gtk/gtkroot.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkroot.c b/gtk/gtkroot.c
index 919aa65f94..dce284a57f 100644
--- a/gtk/gtkroot.c
+++ b/gtk/gtkroot.c
@@ -50,10 +50,18 @@ gtk_root_default_get_display (GtkRoot *self)
return gdk_display_get_default ();
}
+
+static GtkConstraintSolver *
+gtk_root_default_get_constraint_solver (GtkRoot *self)
+{
+ return NULL;
+}
+
static void
gtk_root_default_init (GtkRootInterface *iface)
{
iface->get_display = gtk_root_default_get_display;
+ iface->get_constraint_solver = gtk_root_default_get_constraint_solver;
g_object_interface_install_property (iface,
g_param_spec_object ("focus-widget",
@@ -82,6 +90,17 @@ gtk_root_get_display (GtkRoot *self)
return iface->get_display (self);
}
+GtkConstraintSolver *
+gtk_root_get_constraint_solver (GtkRoot *self)
+{
+ GtkRootInterface *iface;
+
+ g_return_val_if_fail (GTK_IS_ROOT (self), NULL);
+
+ iface = GTK_ROOT_GET_IFACE (self);
+ return iface->get_constraint_solver (self);
+}
+
/**
* gtk_root_set_focus:
* @self: a #GtkRoot