diff options
author | Alexander Larsson <alla@lysator.liu.se> | 2002-04-21 21:15:41 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2002-04-21 21:15:41 +0000 |
commit | df81a1e428ae5707de98925018d2e997691c9e5b (patch) | |
tree | bc6c1431bf08b1cdf247c7a67005ce17caec3179 | |
parent | 3baf2e62efba6bb17d29abf8781cf23bfe8dbcd3 (diff) | |
download | nautilus-df81a1e428ae5707de98925018d2e997691c9e5b.tar.gz |
Only display toplevel window when it's fully constructed.
2002-04-21 Alexander Larsson <alla@lysator.liu.se>
* src/nautilus-window.h:
* src/nautilus-window-manage-views.c:
Only display toplevel window when it's fully constructed.
* src/nautilus-desktop-window.c (nautilus_desktop_window_new):
* src/nautilus-application.c (nautilus_application_create_desktop_window):
Don't show desktop window here. It's shown later when the view
is loaded.
* libnautilus-private/nautilus-horizontal-splitter.c
(nautilus_horizontal_splitter_pack2): Remove old code that is
not neccesary when we display the window fully constructed.
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | libnautilus-private/nautilus-horizontal-splitter.c | 23 | ||||
-rw-r--r-- | src/nautilus-application.c | 2 | ||||
-rw-r--r-- | src/nautilus-desktop-window.c | 2 | ||||
-rw-r--r-- | src/nautilus-navigation-window.h | 9 | ||||
-rw-r--r-- | src/nautilus-object-window.h | 9 | ||||
-rw-r--r-- | src/nautilus-spatial-window.h | 9 | ||||
-rw-r--r-- | src/nautilus-window-manage-views.c | 40 | ||||
-rw-r--r-- | src/nautilus-window.h | 9 |
9 files changed, 78 insertions, 40 deletions
@@ -1,3 +1,18 @@ +2002-04-21 Alexander Larsson <alla@lysator.liu.se> + + * src/nautilus-window.h: + * src/nautilus-window-manage-views.c: + Only display toplevel window when it's fully constructed. + + * src/nautilus-desktop-window.c (nautilus_desktop_window_new): + * src/nautilus-application.c (nautilus_application_create_desktop_window): + Don't show desktop window here. It's shown later when the view + is loaded. + + * libnautilus-private/nautilus-horizontal-splitter.c + (nautilus_horizontal_splitter_pack2): Remove old code that is + not neccesary when we display the window fully constructed. + 2002-04-21 Anders Carlsson <andersca@gnu.org> * libnautilus-private/nautilus-icon-container.c: diff --git a/libnautilus-private/nautilus-horizontal-splitter.c b/libnautilus-private/nautilus-horizontal-splitter.c index 158f2edc3..8aeddf34d 100644 --- a/libnautilus-private/nautilus-horizontal-splitter.c +++ b/libnautilus-private/nautilus-horizontal-splitter.c @@ -283,34 +283,11 @@ void nautilus_horizontal_splitter_pack2 (NautilusHorizontalSplitter *splitter, GtkWidget *child2) { - gboolean re_expose; GtkPaned *paned; g_return_if_fail (GTK_IS_WIDGET (child2)); g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter)); paned = GTK_PANED (splitter); - - re_expose = (paned->child2 == NULL || - !GTK_WIDGET_VISIBLE (paned->child2)); - gtk_paned_pack2 (paned, child2, TRUE, TRUE); - - - if (re_expose) { - /* We have to expose the divider, since the pane relies - * on a resize when you add the 2nd item to get it's - * rendering right */ - - /* this calculates the handle positon correctly */ - gtk_widget_size_allocate (GTK_WIDGET (splitter), - >K_WIDGET (splitter)->allocation); - - /* and this renders it */ - gtk_widget_queue_draw_area (GTK_WIDGET (splitter), - paned->handle_pos.x, - paned->handle_pos.y, - paned->handle_pos.width, - paned->handle_pos.height); - } } diff --git a/src/nautilus-application.c b/src/nautilus-application.c index 7ce3451c8..2b8a8d44a 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -590,8 +590,6 @@ nautilus_application_create_desktop_window (NautilusApplication *application) nautilus_application_desktop_window = nautilus_desktop_window_new (application); create_in_progress = FALSE; - - gtk_widget_show (GTK_WIDGET (nautilus_application_desktop_window)); } void diff --git a/src/nautilus-desktop-window.c b/src/nautilus-desktop-window.c index 7b23baf12..2796af562 100644 --- a/src/nautilus-desktop-window.c +++ b/src/nautilus-desktop-window.c @@ -117,8 +117,6 @@ nautilus_desktop_window_new (NautilusApplication *application) */ nautilus_desktop_window_update_directory (window); - gtk_widget_show (GTK_WIDGET (window)); - return window; } diff --git a/src/nautilus-navigation-window.h b/src/nautilus-navigation-window.h index 9049f571c..8039b94c6 100644 --- a/src/nautilus-navigation-window.h +++ b/src/nautilus-navigation-window.h @@ -62,6 +62,12 @@ typedef struct { void (* add_current_location_to_history_list) (NautilusWindow *window); } NautilusWindowClass; +typedef enum { + NAUTILUS_WINDOW_NOT_SHOWN, + NAUTILUS_WINDOW_POSITION_SET, + NAUTILUS_WINDOW_SHOULD_SHOW +} NautilusWindowShowState; + typedef struct NautilusWindowDetails NautilusWindowDetails; struct NautilusWindow { @@ -101,6 +107,9 @@ struct NautilusWindow { /* Pending changes */ NautilusViewFrame *new_content_view; + + /* Window showed state (for saved_window_positions) */ + NautilusWindowShowState show_state; }; GtkType nautilus_window_get_type (void); diff --git a/src/nautilus-object-window.h b/src/nautilus-object-window.h index 9049f571c..8039b94c6 100644 --- a/src/nautilus-object-window.h +++ b/src/nautilus-object-window.h @@ -62,6 +62,12 @@ typedef struct { void (* add_current_location_to_history_list) (NautilusWindow *window); } NautilusWindowClass; +typedef enum { + NAUTILUS_WINDOW_NOT_SHOWN, + NAUTILUS_WINDOW_POSITION_SET, + NAUTILUS_WINDOW_SHOULD_SHOW +} NautilusWindowShowState; + typedef struct NautilusWindowDetails NautilusWindowDetails; struct NautilusWindow { @@ -101,6 +107,9 @@ struct NautilusWindow { /* Pending changes */ NautilusViewFrame *new_content_view; + + /* Window showed state (for saved_window_positions) */ + NautilusWindowShowState show_state; }; GtkType nautilus_window_get_type (void); diff --git a/src/nautilus-spatial-window.h b/src/nautilus-spatial-window.h index 9049f571c..8039b94c6 100644 --- a/src/nautilus-spatial-window.h +++ b/src/nautilus-spatial-window.h @@ -62,6 +62,12 @@ typedef struct { void (* add_current_location_to_history_list) (NautilusWindow *window); } NautilusWindowClass; +typedef enum { + NAUTILUS_WINDOW_NOT_SHOWN, + NAUTILUS_WINDOW_POSITION_SET, + NAUTILUS_WINDOW_SHOULD_SHOW +} NautilusWindowShowState; + typedef struct NautilusWindowDetails NautilusWindowDetails; struct NautilusWindow { @@ -101,6 +107,9 @@ struct NautilusWindow { /* Pending changes */ NautilusViewFrame *new_content_view; + + /* Window showed state (for saved_window_positions) */ + NautilusWindowShowState show_state; }; GtkType nautilus_window_get_type (void); diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c index 6f3b7d6aa..c9d89b166 100644 --- a/src/nautilus-window-manage-views.c +++ b/src/nautilus-window-manage-views.c @@ -608,6 +608,12 @@ ref_now_unref_at_idle_time (GObject *object) g_idle_add (unref_callback, object); } +static gboolean +use_saved_window_positions (void) +{ + return eel_preferences_get_boolean (NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW); +} + /* This is called when we have decided we can actually change to the new view/location situation. */ static void location_has_really_changed (NautilusWindow *window) @@ -646,12 +652,18 @@ location_has_really_changed (NautilusWindow *window) free_location_change (window); update_title (window); -} -static gboolean -use_saved_window_positions (void) -{ - return eel_preferences_get_boolean (NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW); + /* The whole window has been finished. Now show it, unless + * we're still waiting for the saved positions from the + * metadata. Then tell the callback it needs to show the + * window + */ + if (!use_saved_window_positions () || + window->show_state == NAUTILUS_WINDOW_POSITION_SET) { + gtk_widget_show (GTK_WIDGET (window)); + } else { + window->show_state = NAUTILUS_WINDOW_SHOULD_SHOW; + } } static void @@ -687,9 +699,6 @@ open_location (NautilusWindow *window, if (create_new_window) { target_window = nautilus_application_create_window (window->application); - if (!use_saved_window_positions ()) { - gtk_widget_show (GTK_WIDGET (target_window)); - } } eel_g_list_free_deep (target_window->details->pending_selection); @@ -1124,8 +1133,14 @@ position_and_show_window_callback (NautilusFile *file, g_free (geometry_string); } - gtk_widget_show (GTK_WIDGET (window)); - + /* If we finished constructing the window by now we need + * to show the window here. + */ + if (window->show_state == NAUTILUS_WINDOW_SHOULD_SHOW) { + gtk_widget_show (GTK_WIDGET (window)); + } + window->show_state = NAUTILUS_WINDOW_POSITION_SET; + /* This object was ref'd when starting the callback. */ nautilus_file_unref (file); } @@ -1171,9 +1186,8 @@ determined_initial_view_callback (NautilusDetermineViewHandle *handle, * windows), position and show it only after we've got the * metadata (since position info is stored there). */ - if (!use_saved_window_positions ()) { - gtk_widget_show (GTK_WIDGET (window)); - } else { + if (use_saved_window_positions ()) { + window->show_state = NAUTILUS_WINDOW_NOT_SHOWN; if (!GTK_WIDGET_VISIBLE (window)) { file = nautilus_file_get (location); diff --git a/src/nautilus-window.h b/src/nautilus-window.h index 9049f571c..8039b94c6 100644 --- a/src/nautilus-window.h +++ b/src/nautilus-window.h @@ -62,6 +62,12 @@ typedef struct { void (* add_current_location_to_history_list) (NautilusWindow *window); } NautilusWindowClass; +typedef enum { + NAUTILUS_WINDOW_NOT_SHOWN, + NAUTILUS_WINDOW_POSITION_SET, + NAUTILUS_WINDOW_SHOULD_SHOW +} NautilusWindowShowState; + typedef struct NautilusWindowDetails NautilusWindowDetails; struct NautilusWindow { @@ -101,6 +107,9 @@ struct NautilusWindow { /* Pending changes */ NautilusViewFrame *new_content_view; + + /* Window showed state (for saved_window_positions) */ + NautilusWindowShowState show_state; }; GtkType nautilus_window_get_type (void); |