Commit 9c6c4fde authored by Matthias Clasen's avatar Matthias Clasen

GtkDialog: avoid a crash

Just because use-header-bar is set, it is not safe to assume
every action widget is in the headerbar, so be careful when
setting child properties.
parent add67b51
......@@ -1840,14 +1840,13 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
gpointer user_data)
GtkDialog *dialog = GTK_DIALOG (buildable);
GtkDialogPrivate *priv = dialog->priv;
GSList *l;
ActionWidgetsSubParserData *parser_data;
GObject *object;
ResponseData *ad;
guint signal_id;
if (strcmp (tagname, "action-widgets"))
if (strcmp (tagname, "action-widgets") != 0)
parent_buildable_iface->custom_finished (buildable, builder, child,
tagname, user_data);
......@@ -1887,10 +1886,10 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
g_signal_connect_closure_by_id (object, signal_id, 0, closure, FALSE);
if (!priv->use_header_bar)
apply_response_for_action_area (dialog, GTK_WIDGET (object), ad->response_id);
if (GTK_IS_HEADER_BAR (gtk_widget_get_parent (GTK_WIDGET (object))))
apply_response_for_header_bar (dialog, GTK_WIDGET (object), ad->response_id);
apply_response_for_action_area (dialog, GTK_WIDGET (object), ad->response_id);
if (item->is_default)
gtk_widget_grab_default (GTK_WIDGET (object));
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment