[gnome-terminal] util: Set application on about dialogue



commit cfc99c9399445e4abc1c6e4d5a59b923a4ead9da
Author: Christian Persch <chpe src gnome org>
Date:   Mon Sep 4 20:51:11 2017 +0200

    util: Set application on about dialogue
    
    This makes the shell able to find the correct description and
    icon when the about dialogue is shown; and also holds the
    application until the dialogue is dismissed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786427

 src/terminal-util.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/terminal-util.c b/src/terminal-util.c
index 9bbcbe0..b0c73e0 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -160,7 +160,7 @@ terminal_util_show_help (const char *topic,
 #define EMAILIFY(string) (g_strdelimit ((string), "%", '@'))
 
 void
-terminal_util_show_about (GtkWindow *transient_parent)
+terminal_util_show_about (GtkWindow *transient_parent G_GNUC_UNUSED)
 {
   static const char copyright[] =
     "Copyright © 2002–2004 Havoc Pennington\n"
@@ -178,6 +178,7 @@ terminal_util_show_about (GtkWindow *transient_parent)
   GPtrArray *array;
   gs_free char *comment;
   gs_free char *vte_version;
+  GtkWindow *dialog;
 
   bytes = g_resources_lookup_data (TERMINAL_RESOURCES_PATH_PREFIX "/ui/terminal.about",
                                    G_RESOURCE_LOOKUP_FLAGS_NONE,
@@ -232,7 +233,9 @@ terminal_util_show_about (GtkWindow *transient_parent)
                             vte_version,
                             vte_get_features ());
 
-  gtk_show_about_dialog (transient_parent,
+  dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
+                         /* Hold the application while the window is shown */
+                         "application", terminal_app_get (),
                          "program-name", _("GNOME Terminal"),
                          "copyright", copyright,
                          "comments", comment,
@@ -247,6 +250,9 @@ terminal_util_show_about (GtkWindow *transient_parent)
                          "logo-icon-name", GNOME_TERMINAL_ICON_NAME,
                          NULL);
 
+  g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+  gtk_window_present (dialog);
+
   g_strfreev (array_strv);
   g_strfreev (artists);
   g_strfreev (documenters);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]