summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Benítez León <nbenitezl+gnome@gmail.com>2014-12-27 00:27:36 +0500
committerMichael Catanzaro <mcatanzaro@gnome.org>2014-12-27 09:46:22 -0600
commitc9f259ca8f5541ac879320b5d168ae7b4bc46d86 (patch)
treeb84cd12d283a00fa2c700fcfda7b6dfb8a5f6193
parent4c6f77da1b675533aac5bb8a2fe646c1d99f80d9 (diff)
downloadnautilus-c9f259ca8f5541ac879320b5d168ae7b4bc46d86.tar.gz
nautilus-window: make sure active slot is closed last
When destroying window and closing all slots, the closing of the active slot will trigger activation of next free slot, we don't want to be activating slots as part of 'closing all slots' logic. Fixes bug 741952
-rw-r--r--src/nautilus-window.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 124fc57b7..38dea3503 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1531,6 +1531,18 @@ nautilus_window_get_property (GObject *object,
}
}
+static gint
+sort_slots_active_last (NautilusWindowSlot *a, NautilusWindowSlot *b, NautilusWindow *window)
+{
+ if (window->details->active_slot == a) {
+ return 1;
+ }
+ if (window->details->active_slot == b) {
+ return -1;
+ }
+ return 0;
+}
+
static void
destroy_slots_foreach (gpointer data,
gpointer user_data)
@@ -1557,6 +1569,11 @@ nautilus_window_destroy (GtkWidget *object)
/* close all slots safely */
slots_copy = g_list_copy (window->details->slots);
+ if (window->details->active_slot != NULL) {
+ /* Make sure active slot is last one to be closed, to avoid default activation
+ * of others slots when closing the active one, see bug #741952 */
+ slots_copy = g_list_sort_with_data (slots_copy, (GCompareFunc) sort_slots_active_last, window);
+ }
g_list_foreach (slots_copy, (GFunc) destroy_slots_foreach, window);
g_list_free (slots_copy);