From 5b2ee4af6fafecfff78f15662c94e62470a9a43d Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 29 May 2013 18:54:55 -0400 Subject: Make EAlertDialog non-resizable. Making EAlertDialog non-resizable is the only way at present for GTK+ to pick a resonable default size, otherwise we get alerts looking like this: https://bugzilla.gnome.org/attachment.cgi?id=221303 See https://bugzilla.gnome.org/681937 for details. Also drop the default window size hack in alert_dialog_constructed(). --- e-util/e-alert-dialog.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c index 8a75101997..b4e12ad8c9 100644 --- a/e-util/e-alert-dialog.c +++ b/e-util/e-alert-dialog.c @@ -125,8 +125,6 @@ alert_dialog_constructed (GObject *object) GList *actions; const gchar *primary, *secondary; gint default_response; - gint min_width = -1, prefer_width = -1; - gint height; /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_alert_dialog_parent_class)->constructed (object); @@ -138,6 +136,11 @@ alert_dialog_constructed (GObject *object) gtk_window_set_title (GTK_WINDOW (dialog), " "); + /* XXX Making the window non-resizable is the only way at + * present for GTK+ to pick a reasonable default size. + * See https://bugzilla.gnome.org/681937 for details. */ + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); @@ -251,17 +254,6 @@ alert_dialog_constructed (GObject *object) gtk_widget_set_can_focus (widget, FALSE); gtk_widget_show (widget); - widget = GTK_WIDGET (dialog); - - height = gtk_widget_get_allocated_height (widget); - gtk_widget_get_preferred_width_for_height ( - widget, height, &min_width, &prefer_width); - if (min_width < prefer_width) - gtk_window_set_default_size ( - GTK_WINDOW (dialog), MIN ( - (min_width + prefer_width) / 2, - min_width * 5 / 4), -1); - pango_attr_list_unref (list); } -- cgit v1.2.3