[gtk+] aboutdialog: Only close on delete events



commit d607312080607f18c1921ea9dd5cca7a5daa0bfd
Author: Timm Bäder <mail baedert org>
Date:   Thu Jan 18 14:38:27 2018 +0100

    aboutdialog: Only close on delete events
    
    Clicking on the Credits button should not close the dialog.

 gtk/gtkaboutdialog.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index bc971ac..3dff624 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -239,7 +239,6 @@ static void                 set_cursor_if_appropriate       (GtkAboutDialog
 static void                 populate_credits_page           (GtkAboutDialog     *about);
 static void                 populate_license_page           (GtkAboutDialog     *about);
 static void                 populate_system_page            (GtkAboutDialog     *about);
-static void                 close_cb                        (GtkAboutDialog     *about);
 static gboolean             gtk_about_dialog_activate_link  (GtkAboutDialog     *about,
                                                              const gchar        *uri);
 static gboolean             emit_activate_link              (GtkAboutDialog     *about,
@@ -2474,11 +2473,16 @@ gtk_about_dialog_new (void)
 }
 
 static void
-close_cb (GtkAboutDialog *about)
+close_cb (GtkAboutDialog *about,
+          int             response_id,
+          gpointer        user_data)
 {
-  switch_page (about, "main");
+  if (response_id == GTK_RESPONSE_DELETE_EVENT)
+    {
+      switch_page (about, "main");
 
-  gtk_widget_hide (GTK_WIDGET (about));
+      gtk_widget_hide (GTK_WIDGET (about));
+    }
 }
 
 /**


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