static void open_window (NemoMainApplication *application, GFile *location, GdkScreen *screen, const char *geometry) { NemoWindow *window; gchar *uri; gboolean have_geometry; uri = g_file_get_uri (location); DEBUG ("Opening new window at uri %s", uri); window = nemo_main_application_create_window (application, screen); nemo_window_go_to (window, location); have_geometry = geometry != NULL && strcmp(geometry, "") != 0; if (have_geometry && !gtk_widget_get_visible (GTK_WIDGET (window))) { /* never maximize windows opened from shell if a * custom geometry has been requested. */ gtk_window_unmaximize (GTK_WINDOW (window)); eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), geometry, APPLICATION_WINDOW_MIN_WIDTH, APPLICATION_WINDOW_MIN_HEIGHT, FALSE); } g_free (uri); }
static void open_window (NautilusApplication *application, GFile *location, GdkScreen *screen, const char *geometry) { NautilusWindow *window; nautilus_profile_start (NULL); window = nautilus_application_create_window (application, screen); if (location != NULL) { nautilus_window_go_to (window, location); } else { nautilus_window_slot_go_home (nautilus_window_get_active_slot (window), 0); } if (geometry != NULL && !gtk_widget_get_visible (GTK_WIDGET (window))) { /* never maximize windows opened from shell if a * custom geometry has been requested. */ gtk_window_unmaximize (GTK_WINDOW (window)); eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), geometry, APPLICATION_WINDOW_MIN_WIDTH, APPLICATION_WINDOW_MIN_HEIGHT, FALSE); } nautilus_profile_end (NULL); }
static void caja_bookmarks_window_restore_geometry (GtkWidget *window) { const char *window_geometry; g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (CAJA_IS_BOOKMARK_LIST (bookmarks)); window_geometry = caja_bookmark_list_get_window_geometry (bookmarks); if (window_geometry != NULL) { eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), window_geometry, BOOKMARKS_WINDOW_MIN_WIDTH, BOOKMARKS_WINDOW_MIN_HEIGHT, FALSE); } else { /* use default since there was no stored geometry */ gtk_window_set_default_size (GTK_WINDOW (window), BOOKMARKS_WINDOW_INITIAL_WIDTH, BOOKMARKS_WINDOW_INITIAL_HEIGHT); /* Let window manager handle default position if no position stored */ } }
static NemoWindow * nemo_main_application_create_window (NemoApplication *application, GdkScreen *screen) { NemoWindow *window; char *geometry_string; gboolean maximized; g_return_val_if_fail (NEMO_IS_APPLICATION (application), NULL); window = nemo_window_new (GTK_APPLICATION (application), screen); maximized = g_settings_get_boolean (nemo_window_state, NEMO_WINDOW_STATE_MAXIMIZED); if (maximized) { gtk_window_maximize (GTK_WINDOW (window)); } else { gtk_window_unmaximize (GTK_WINDOW (window)); } geometry_string = g_settings_get_string (nemo_window_state, NEMO_WINDOW_STATE_GEOMETRY); if (geometry_string != NULL && geometry_string[0] != 0) { /* Ignore saved window position if a window with the same * location is already showing. That way the two windows * wont appear at the exact same location on the screen. */ eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), geometry_string, NEMO_WINDOW_MIN_WIDTH, NEMO_WINDOW_MIN_HEIGHT, TRUE); } g_free (geometry_string); nemo_undo_manager_attach (application->undo_manager, G_OBJECT (window)); DEBUG ("Creating a new navigation window"); return window; }
NautilusWindow * nautilus_application_create_window (NautilusApplication *application, GdkScreen *screen) { NautilusWindow *window; char *geometry_string; gboolean maximized; g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL); nautilus_profile_start (NULL); window = nautilus_window_new (screen); maximized = g_settings_get_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_MAXIMIZED); if (maximized) { gtk_window_maximize (GTK_WINDOW (window)); } else { gtk_window_unmaximize (GTK_WINDOW (window)); } geometry_string = g_settings_get_string (nautilus_window_state, NAUTILUS_WINDOW_STATE_GEOMETRY); if (geometry_string != NULL && geometry_string[0] != 0) { /* Ignore saved window position if a window with the same * location is already showing. That way the two windows * wont appear at the exact same location on the screen. */ eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), geometry_string, NAUTILUS_WINDOW_MIN_WIDTH, NAUTILUS_WINDOW_MIN_HEIGHT, another_navigation_window_already_showing (application, window)); } g_free (geometry_string); DEBUG ("Creating a new navigation window"); nautilus_profile_end (NULL); return window; }