summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2003-12-15 22:03:15 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2003-12-15 22:03:15 +0000
commit69c2585f0d78c5c00b0dff296b28eddea964ed1f (patch)
tree3068870081ce5a0ccf2c727b4e03eec362005675 /gtk
parent7054ddccd816256894bb048e4937a44f332137fb (diff)
downloadgtk+-69c2585f0d78c5c00b0dff296b28eddea964ed1f.tar.gz
Sigh, revert the change.
2003-12-15 Federico Mena Quintero <federico@ximian.com> * gtk/gtkdialog.c: Sigh, revert the change.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkdialog.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index fb4ca8bec0..7f81f9d83d 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -354,6 +354,30 @@ gtk_dialog_style_set (GtkWidget *widget,
update_spacings (GTK_DIALOG (widget));
}
+static gboolean
+dialog_has_cancel (GtkDialog *dialog)
+{
+ GList *children, *tmp_list;
+ gboolean ret = FALSE;
+
+ children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
+
+ for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
+ {
+ ResponseData *rd = get_response_data (tmp_list->data);
+
+ if (rd && rd->response_id == GTK_RESPONSE_CANCEL)
+ {
+ ret = TRUE;
+ break;
+ }
+ }
+
+ g_list_free (children);
+
+ return ret;
+}
+
static void
gtk_dialog_close (GtkDialog *dialog)
{
@@ -362,6 +386,9 @@ gtk_dialog_close (GtkDialog *dialog)
GtkWidget *widget = GTK_WIDGET (dialog);
GdkEvent *event;
+ if (!dialog_has_cancel (dialog))
+ return;
+
event = gdk_event_new (GDK_DELETE);
event->any.window = g_object_ref (widget->window);