2009-02-04 Alberto Garcia <agarcia@igalia.com>
authorAlberto Garcia <agarcia@igalia.com>
Wed, 4 Feb 2009 15:56:47 +0000 (15:56 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Wed, 4 Feb 2009 15:56:47 +0000 (15:56 +0000)
* src/hildon-window-stack.c (hildon_window_stack_remove): When a
window is removed from the middle of the stack, update the
transiency of the previous one.

Fixes: NB#100487 (HildonStackableWindow transiency becomes
incoherent)

ChangeLog
src/hildon-window-stack.c

index 5d39c76..a6c1957 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-02-04  Alberto Garcia  <agarcia@igalia.com>
+
+       * src/hildon-window-stack.c (hildon_window_stack_remove): When a
+       window is removed from the middle of the stack, update the
+       transiency of the previous one.
+
+       Fixes: NB#100487 (HildonStackableWindow transiency becomes
+       incoherent)
+
 2009-02-02  Claudio Saavedra  <csaavedra@igalia.com>
 
        * src/hildon-picker-dialog.c: (_restore_current_selection): Do not
index 419aba0..3eed16d 100644 (file)
@@ -172,12 +172,26 @@ hildon_window_stack_remove                      (HildonStackableWindow *win)
 
     /* If the window is stacked */
     if (stack) {
+        GList *pos;
+
         hildon_stackable_window_set_stack (win, NULL, -1);
-        stack->priv->list = g_list_remove (stack->priv->list, win);
         gtk_window_set_transient_for (GTK_WINDOW (win), NULL);
         if (GTK_WIDGET (win)->window) {
             gdk_window_set_group (GTK_WIDGET (win)->window, NULL);
         }
+
+        /* If the window removed is in the middle of the stack, update
+         * transiency of other windows */
+        pos = g_list_find (stack->priv->list, win);
+        g_assert (pos != NULL);
+        if (pos->prev) {
+            GtkWindow *upper = GTK_WINDOW (pos->prev->data);
+            GtkWindow *lower = pos->next ? GTK_WINDOW (pos->next->data) : NULL;
+            gtk_window_set_transient_for (upper, lower);
+        }
+
+        stack->priv->list = g_list_remove (stack->priv->list, win);
+
         g_signal_handlers_disconnect_by_func (win, hildon_window_stack_window_realized, stack);
     }
 }