summaryrefslogtreecommitdiff
path: root/plugins/gtk+
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-10-02 16:08:23 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-10-02 16:18:25 -0300
commit7acdd3c6f6934f47b8974ebc2190a59ea5d2ed17 (patch)
treeac6ef5994f2b8d2f4b54b17db0d1352855ae77ee /plugins/gtk+
parent9e66cdfb97a89952e2a58fa702f1841dc302479a (diff)
downloadglade-7acdd3c6f6934f47b8974ebc2190a59ea5d2ed17.tar.gz
GladeGtkBox: fix glade_gtk_box_post_create
Some widgets with contruct properties like GtkMessageDialog get rebuilt right after they are created on project loading so we need to check glade_project_is_loading() intead of GLADE_CREATE_LOAD and use the object ad the connect data to make sure it gets disconected if it was the object being rebuilt Fix issue #479 "Glade 3.36.0 segfaults when opening a file"
Diffstat (limited to 'plugins/gtk+')
-rw-r--r--plugins/gtk+/glade-gtk-box.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/gtk+/glade-gtk-box.c b/plugins/gtk+/glade-gtk-box.c
index 0c157a6d..a0252b6a 100644
--- a/plugins/gtk+/glade-gtk-box.c
+++ b/plugins/gtk+/glade-gtk-box.c
@@ -58,9 +58,9 @@ glade_gtk_box_create_editable (GladeWidgetAdaptor *adaptor,
}
static void
-glade_gtk_box_parse_finished (GladeProject *project, GladeWidget *gbox)
+glade_gtk_box_parse_finished (GladeProject *project, GObject *box)
{
- GObject *box = glade_widget_get_object (gbox);
+ GladeWidget *gbox = glade_widget_get_from_gobject (box);
glade_widget_property_set (gbox, "use-center-child",
gtk_box_get_center_widget (GTK_BOX (box)) != NULL);
@@ -87,11 +87,11 @@ glade_gtk_box_post_create (GladeWidgetAdaptor *adaptor,
g_signal_connect (G_OBJECT (gwidget), "configure-end",
G_CALLBACK (glade_gtk_box_configure_end), container);
- if (reason == GLADE_CREATE_LOAD)
+ if (glade_project_is_loading (project))
{
g_signal_connect_object (project, "parse-finished",
G_CALLBACK (glade_gtk_box_parse_finished),
- gwidget, 0);
+ container, 0);
}
}