diff options
-rw-r--r-- | chrome/common/platform_util_linux.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/common/platform_util_linux.cc b/chrome/common/platform_util_linux.cc index 697f307..5baaefc 100644 --- a/chrome/common/platform_util_linux.cc +++ b/chrome/common/platform_util_linux.cc @@ -93,8 +93,23 @@ void SimpleErrorBox(gfx::NativeWindow parent, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", UTF16ToUTF8(message).c_str()); gtk_util::ApplyMessageDialogQuirks(dialog); gtk_window_set_title(GTK_WINDOW(dialog), UTF16ToUTF8(title).c_str()); + g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL); gtk_widget_show_all(dialog); + + // Make sure it's big enough to show the title. + GtkRequisition req; + gtk_widget_size_request(dialog, &req); + int width; + gtk_util::GetWidgetSizeFromCharacters(dialog, title.length(), 0, + &width, NULL); + // The fudge factor accounts for extra space needed by the frame + // decorations as well as width differences between average text and the + // actual title text. + width = width * 1.2 + 50; + + if (width > req.width) + gtk_widget_set_size_request(dialog, width, -1); } /* Warning: this may be either Linux or ChromeOS */ |