[epiphany/wip/exalm/gtk4-cleanups-2: 21/27] window-commands: Stop using gtk_dialog_run() for about dialog




commit cd91747fc809c792c9c64e38ac37748a60bbcaa8
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Nov 30 17:56:27 2021 +0500

    window-commands: Stop using gtk_dialog_run() for about dialog
    
    It also needed a manual modal=true, turns out gtk_dialog_run() does that
    implicitly.

 src/window-commands.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/window-commands.c b/src/window-commands.c
index 44256c24d..ef340197a 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -979,8 +979,10 @@ window_cmd_show_about (GSimpleAction *action,
 
   dialog = GTK_ABOUT_DIALOG (gtk_about_dialog_new ());
 
-  if (window)
+  if (window) {
     gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+    gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+  }
 
   if (g_str_equal (PROFILE, "Canary"))
     gtk_about_dialog_set_program_name (dialog, _("Epiphany Canary"));
@@ -1034,8 +1036,9 @@ window_cmd_show_about (GSimpleAction *action,
   gtk_about_dialog_set_documenters (dialog, (const char **)documenters);
   gtk_about_dialog_set_translator_credits (dialog, _("translator-credits"));
 
-  gtk_dialog_run (GTK_DIALOG (dialog));
-  gtk_widget_destroy (GTK_WIDGET (dialog));
+  g_signal_connect (dialog, "response",
+                    G_CALLBACK (gtk_widget_destroy), NULL);
+  gtk_window_present (GTK_WINDOW (dialog));
 
   g_free (comments);
   g_strfreev (artists);


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