* src/hildon-stackable-window.c (hildon_stackable_window_delete_event) (hildon_stacka...
authorAlberto Garcia <agarcia@igalia.com>
Tue, 24 Jun 2008 18:30:33 +0000 (18:30 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Tue, 24 Jun 2008 18:30:33 +0000 (18:30 +0000)
ChangeLog
src/hildon-stackable-window.c

index 1754c63..56a079f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,9 @@
        Send delete events starting from the topmost window.
        Stop if one of the windows is not destroyed.
        Update doc.
+       (hildon_stackable_window_delete_event)
+       (hildon_stackable_window_class_init):
+       Ignore the delete event if the window is not the topmost one.
 
 2008-06-24  Alejandro G. Castro <alex@igalia.com>
 
index eaa38f9..aaf840a 100644 (file)
@@ -179,6 +179,22 @@ hildon_stackable_window_realize                 (GtkWidget *widget)
                     (guchar *)&atom, 1);
 }
 
+static gboolean
+hildon_stackable_window_delete_event            (GtkWidget *widget,
+                                                 GdkEventAny *event)
+{
+    GSList *list = get_window_list (widget);
+    list = g_slist_find (list, widget);
+
+    /* Ignore the delete event if this is not the topmost window */
+    if (list != NULL && list->next != NULL)
+        return TRUE;
+    else if (GTK_WIDGET_CLASS (hildon_stackable_window_parent_class)->delete_event)
+        return GTK_WIDGET_CLASS (hildon_stackable_window_parent_class)->delete_event (widget, event);
+    else
+        return FALSE;
+}
+
 static void
 hildon_stackable_window_class_init              (HildonStackableWindowClass *klass)
 {
@@ -188,6 +204,7 @@ hildon_stackable_window_class_init              (HildonStackableWindowClass *kla
     widget_class->map               = hildon_stackable_window_map;
     widget_class->unmap             = hildon_stackable_window_unmap;
     widget_class->realize           = hildon_stackable_window_realize;
+    widget_class->delete_event      = hildon_stackable_window_delete_event;
 
     window_class->unset_program     = hildon_stackable_window_unset_program;