static gboolean nemo_window_delete_event_callback (GtkWidget *widget, GdkEvent *event, gpointer user_data) { NemoWindow *window; window = NEMO_WINDOW (widget); nemo_window_close (window); return TRUE; }
void nemo_application_close_all_windows (NemoApplication *self) { GList *list_copy; GList *l; list_copy = g_list_copy (gtk_application_get_windows (GTK_APPLICATION (self))); for (l = list_copy; l != NULL; l = l->next) { NemoWindow *window; window = NEMO_WINDOW (l->data); nemo_window_close (window); } g_list_free (list_copy); }
void nemo_window_pane_slot_close (NemoWindowPane *pane, NemoWindowSlot *slot) { NemoWindowSlot *next_slot; DEBUG ("Requesting to remove slot %p from pane %p", slot, pane); if (pane->window) { NemoWindow *window; window = pane->window; if (pane->active_slot == slot) { next_slot = get_first_inactive_slot (NEMO_WINDOW_PANE (pane)); nemo_window_set_active_slot (window, next_slot); } nemo_window_pane_close_slot (pane, slot); /* If that was the last slot in the pane, close the pane or even the whole window. */ if (pane->slots == NULL) { if (nemo_window_split_view_showing (window)) { NemoWindowPane *new_pane; DEBUG ("Last slot removed from the pane %p, closing it", pane); nemo_window_close_pane (window, pane); new_pane = g_list_nth_data (window->details->panes, 0); if (new_pane->active_slot == NULL) { new_pane->active_slot = get_first_inactive_slot (new_pane); } DEBUG ("Calling set_active_pane, new slot %p", new_pane->active_slot); nemo_window_set_active_pane (window, new_pane); nemo_window_update_show_hide_menu_items (window); } else { DEBUG ("Last slot removed from the last pane, close the window"); nemo_window_close (window); } } } }