/* FIXME remove when gtknotebook's func for this becomes public, bug #.... */ static NautilusNotebook * find_notebook_at_pointer (gint abs_x, gint abs_y) { GdkWindow *win_at_pointer, *toplevel_win; gpointer toplevel = NULL; gint x, y; /* FIXME multi-head */ win_at_pointer = gdk_window_at_pointer (&x, &y); if (win_at_pointer == NULL) { /* We are outside all windows containing a notebook */ return NULL; } toplevel_win = gdk_window_get_toplevel (win_at_pointer); /* get the GtkWidget which owns the toplevel GdkWindow */ gdk_window_get_user_data (toplevel_win, &toplevel); /* toplevel should be an NautilusWindow */ if (toplevel != NULL && NAUTILUS_IS_NAVIGATION_WINDOW (toplevel)) { return NAUTILUS_NOTEBOOK (NAUTILUS_NAVIGATION_WINDOW (toplevel)->notebook); } return NULL; }
/* FIXME remove when gtknotebook's func for this becomes public, bug #.... */ static NautilusNotebook * find_notebook_at_pointer (gint abs_x, gint abs_y) { GdkDeviceManager *manager; GdkDevice *pointer; GdkWindow *win_at_pointer, *toplevel_win; gpointer toplevel = NULL; gint x, y; /* FIXME multi-head */ manager = gdk_display_get_device_manager (gdk_display_get_default ()); pointer = gdk_device_manager_get_client_pointer (manager); win_at_pointer = gdk_device_get_window_at_position (pointer, &x, &y); if (win_at_pointer == NULL) { /* We are outside all windows containing a notebook */ return NULL; } toplevel_win = gdk_window_get_toplevel (win_at_pointer); /* get the GtkWidget which owns the toplevel GdkWindow */ gdk_window_get_user_data (toplevel_win, &toplevel); /* toplevel should be an NautilusWindow */ if (toplevel != NULL && NAUTILUS_IS_WINDOW (toplevel)) { return NAUTILUS_NOTEBOOK (NAUTILUS_WINDOW (toplevel)->details->notebook); } return NULL; }
static void real_sync_title (NautilusWindow *window, NautilusWindowSlot *slot) { NautilusNavigationWindow *navigation_window; NautilusNavigationWindowPane *pane; NautilusNotebook *notebook; char *full_title; char *window_title; navigation_window = NAUTILUS_NAVIGATION_WINDOW (window); EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS, sync_title, (window, slot)); if (slot == window->details->active_pane->active_slot) { /* if spatial mode is default, we keep "File Browser" in the window title * to recognize browser windows. Otherwise, we default to the directory name. */ if (!eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) { full_title = g_strdup_printf (_("%s - File Browser"), slot->title); window_title = eel_str_middle_truncate (full_title, MAX_TITLE_LENGTH); g_free (full_title); } else { window_title = eel_str_middle_truncate (slot->title, MAX_TITLE_LENGTH); } gtk_window_set_title (GTK_WINDOW (window), window_title); g_free (window_title); } pane = NAUTILUS_NAVIGATION_WINDOW_PANE (slot->pane); notebook = NAUTILUS_NOTEBOOK (pane->notebook); nautilus_notebook_sync_tab_label (notebook, slot); }
static void action_tabs_move_right_callback (GtkAction *action, gpointer user_data) { NautilusWindow *window = user_data; nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (window->details->notebook), 1); }
static void action_tabs_next_callback (GtkAction *action, gpointer user_data) { NautilusWindow *window = user_data; nautilus_notebook_next_page (NAUTILUS_NOTEBOOK (window->details->notebook)); }
static void action_tabs_previous_callback (GtkAction *action, gpointer user_data) { NautilusWindow *window = user_data; nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (window->details->notebook), -1); }
static void real_sync_allow_stop (NautilusWindow *window, NautilusWindowSlot *slot) { NautilusNavigationWindow *navigation_window; NautilusNotebook *notebook; navigation_window = NAUTILUS_NAVIGATION_WINDOW (window); nautilus_navigation_window_set_spinner_active (navigation_window, slot->allow_stop); notebook = NAUTILUS_NOTEBOOK (NAUTILUS_NAVIGATION_WINDOW_PANE (slot->pane)->notebook); nautilus_notebook_sync_loading (notebook, slot); }