mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 04:31:09 +00:00
window: Create constraint solver on demand
This commit is contained in:
parent
8a7fb4b133
commit
ddaf50dfcc
@ -1602,9 +1602,6 @@ gtk_window_init (GtkWindow *window)
|
||||
G_CALLBACK (gtk_window_handle_focus), window);
|
||||
gtk_widget_add_controller (widget, controller);
|
||||
|
||||
/* Shared constraint solver */
|
||||
priv->constraint_solver = gtk_constraint_solver_new ();
|
||||
|
||||
controller = gtk_shortcut_controller_new ();
|
||||
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
|
||||
|
||||
@ -1875,6 +1872,12 @@ gtk_window_root_get_constraint_solver (GtkRoot *root)
|
||||
GtkWindow *self = GTK_WINDOW (root);
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (self);
|
||||
|
||||
if (!priv->constraint_solver)
|
||||
{
|
||||
/* Shared constraint solver */
|
||||
priv->constraint_solver = gtk_constraint_solver_new ();
|
||||
}
|
||||
|
||||
return priv->constraint_solver;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user