[gtk+/wip/matthiasc/kill-event-signals: 49/126] file chooser button: Stop connecting to ::delete-event



commit 82eb6934f58fb42e5c0f70aecd1b4edce118ba4b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Dec 31 11:41:59 2017 -0500

    file chooser button: Stop connecting to ::delete-event
    
    We can just use GtkWindow::hide-on-close.

 gtk/gtkfilechooserbutton.c |   16 +---------------
 1 files changed, 1 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index 06ebf0f..5c57199 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -323,9 +323,6 @@ static void     chooser_update_preview_cb        (GtkFileChooser *dialog,
 static void     chooser_notify_cb                (GObject        *dialog,
                                                  GParamSpec     *pspec,
                                                  gpointer        user_data);
-static gboolean dialog_delete_event_cb           (GtkWidget      *dialog,
-                                                 GdkEvent       *event,
-                                                 gpointer        user_data);
 static void     dialog_response_cb               (GtkDialog      *dialog,
                                                  gint            response,
                                                  gpointer        user_data);
@@ -837,12 +834,11 @@ gtk_file_chooser_button_constructed (GObject *object)
   else /* dialog set */
     {
       priv->chooser = GTK_FILE_CHOOSER (priv->dialog);
+      gtk_window_set_hide_on_close (GTK_WINDOW (priv->chooser), TRUE);
 
       if (!gtk_window_get_title (GTK_WINDOW (priv->dialog)))
         gtk_file_chooser_button_set_title (button, _(DEFAULT_TITLE));
 
-      g_signal_connect (priv->dialog, "delete-event",
-                        G_CALLBACK (dialog_delete_event_cb), object);
       g_signal_connect (priv->dialog, "response",
                         G_CALLBACK (dialog_response_cb), object);
 
@@ -2877,16 +2873,6 @@ chooser_notify_cb (GObject    *dialog,
     }
 }
 
-static gboolean
-dialog_delete_event_cb (GtkWidget *dialog,
-                       GdkEvent  *event,
-                       gpointer   user_data)
-{
-  g_signal_emit_by_name (dialog, "response", GTK_RESPONSE_DELETE_EVENT);
-
-  return TRUE;
-}
-
 static void
 common_response_cb (GtkFileChooserButton *button,
                    gint       response)


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