[nautilus/wip/exalm/libhandy: 8/13] window: Simplify slot cleanup
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/exalm/libhandy: 8/13] window: Simplify slot cleanup
- Date: Thu, 21 Jul 2022 15:26:32 +0000 (UTC)
commit 0ede9635d91fd1a116253fd5e007fe04de4cd6d0
Author: António Fernandes <antoniof gnome org>
Date: Wed Jul 13 12:31:32 2022 +0100
window: Simplify slot cleanup
We currently rely on sorting the list of slots in order to close the
active slot last when disposing of a window.
But the bug this works around only happens because we are actually
closing the tabs too. That's not necessary: widgets are going to be
destroyed later anyway along with their parents.
src/nautilus-window.c | 28 +++-------------------------
1 file changed, 3 insertions(+), 25 deletions(-)
---
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 5b835848d..8694964ca 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1599,30 +1599,14 @@ nautilus_window_constructed (GObject *self)
nautilus_profile_end (NULL);
}
-static gint
-sort_slots_active_last (NautilusWindowSlot *a,
- NautilusWindowSlot *b,
- NautilusWindow *window)
-{
- if (window->active_slot == a)
- {
- return 1;
- }
- if (window->active_slot == b)
- {
- return -1;
- }
- return 0;
-}
-
static void
-destroy_slots_foreach (gpointer data,
+remove_slots_foreach (gpointer data,
gpointer user_data)
{
NautilusWindowSlot *slot = data;
NautilusWindow *window = user_data;
- close_slot (window, slot, TRUE);
+ close_slot (window, slot, FALSE);
}
static void
@@ -1641,13 +1625,7 @@ nautilus_window_dispose (GObject *object)
/* close all slots safely */
slots_copy = g_list_copy (window->slots);
- if (window->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, (GCompareDataFunc) sort_slots_active_last, window);
- }
- g_list_foreach (slots_copy, (GFunc) destroy_slots_foreach, window);
+ g_list_foreach (slots_copy, (GFunc) remove_slots_foreach, window);
g_list_free (slots_copy);
/* the slots list should now be empty */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]