From 322f6c740f631abc24cc26fa2b81307eae18ef2c Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Thu, 27 Feb 2014 14:19:32 -0500 Subject: [PATCH] dialogs: always use CSD on dialogs If we aren't using a header bar then put a fake titlebar box on it so we can round the corners. One of the advantages of this is so that the styling of the dialog is completely within one theme framework. This prevents skew between the theming expectations from the window manager and GTK+. https://bugzilla.gnome.org/show_bug.cgi?id=725345 --- gtk/gtkdialog.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 8e5797fbaf..37d9bf0bce 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -279,7 +279,18 @@ apply_use_header_bar (GtkDialog *dialog) gtk_widget_set_visible (priv->action_area, !priv->use_header_bar); gtk_widget_set_visible (priv->headerbar, priv->use_header_bar); if (!priv->use_header_bar) - gtk_window_set_titlebar (GTK_WINDOW (dialog), NULL); + { + GtkWidget *box = NULL; + + if (gtk_window_get_type_hint (GTK_WINDOW (dialog)) == GDK_WINDOW_TYPE_HINT_DIALOG) + { + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_show (box); + gtk_widget_set_size_request (box, -1, 16); + } + + gtk_window_set_titlebar (GTK_WINDOW (dialog), box); + } if (priv->use_header_bar) g_signal_connect (priv->action_area, "add", G_CALLBACK (add_cb), dialog); }