diff options
author | Alexander Larsson <alexl@redhat.com> | 2008-10-09 12:49:01 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2008-10-09 12:49:01 +0000 |
commit | 95c54a990f9288322dfad0ccf3ca0739510b59f9 (patch) | |
tree | 75087aee7612f02a12efe4e56447296eaf701a42 | |
parent | e017923a6e23e91fdf12674ba95ab88867ebeec6 (diff) | |
download | nautilus-95c54a990f9288322dfad0ccf3ca0739510b59f9.tar.gz |
Save spatial geometry on window close, not slot close. Slot close is to
2008-10-09 Alexander Larsson <alexl@redhat.com>
* src/nautilus-spatial-window.c:
(real_window_close):
(nautilus_spatial_window_class_init):
Save spatial geometry on window close, not slot close.
Slot close is to late in the close by window destry case,
as the windows have then been unrealized.
svn path=/trunk/; revision=14714
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/nautilus-spatial-window.c | 23 |
2 files changed, 24 insertions, 8 deletions
@@ -1,5 +1,14 @@ 2008-10-09 Alexander Larsson <alexl@redhat.com> + * src/nautilus-spatial-window.c: + (real_window_close): + (nautilus_spatial_window_class_init): + Save spatial geometry on window close, not slot close. + Slot close is to late in the close by window destry case, + as the windows have then been unrealized. + +2008-10-09 Alexander Larsson <alexl@redhat.com> + * src/nautilus-main.c (main): Make sure uri list is NULL terminated diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index d0814c93d..6c6a0cd48 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -460,17 +460,24 @@ real_open_slot (NautilusWindow *window, } static void -real_close_slot (NautilusWindow *window, - NautilusWindowSlot *slot) +real_window_close (NautilusWindow *window) { - g_assert (g_list_length (window->details->slots) == 1); + NautilusWindowSlot *slot; - nautilus_spatial_window_save_geometry (slot); - nautilus_spatial_window_save_scroll_position (slot); - nautilus_spatial_window_save_show_hidden_files_mode (slot); + /* We're closing the window, save the geometry. */ + /* Note that we do this in window close, not slot close, because slot + close is too late, by then the widgets have been unrealized. */ + if (window->details->slots != NULL) { + slot = window->details->slots->data; + + nautilus_spatial_window_save_geometry (slot); + nautilus_spatial_window_save_scroll_position (slot); + nautilus_spatial_window_save_show_hidden_files_mode (slot); + } + EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS, - close_slot, (window, slot)); + close, (window)); } static void @@ -1039,7 +1046,7 @@ nautilus_spatial_window_class_init (NautilusSpatialWindowClass *class) real_set_allow_up; NAUTILUS_WINDOW_CLASS (class)->open_slot = real_open_slot; - NAUTILUS_WINDOW_CLASS (class)->close_slot = real_close_slot; + NAUTILUS_WINDOW_CLASS (class)->close = real_window_close; binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_SHIFT_MASK, |