~ubuntu-branches/ubuntu/raring/nautilus/raring

« back to all changes in this revision

Viewing changes to src/nautilus-notebook.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Jeremy Bicha
  • Date: 2012-01-31 13:45:01 UTC
  • mfrom: (1.17.25)
  • Revision ID: package-import@ubuntu.com-20120131134501-yn7mqny7fgzx9fao
Tags: 1:3.3.4-0ubuntu1
* New upstream version which fixes:
  - "Opening Popupmenu in Context of Folder with List-View impossible?"
    (lp: #126540)
  - "'Create folder in here' context menu option for nautilus" (lp: #61786)
  - the file count and the size count change in opposite direction.
    (lp: #503330)
  - the mounts in the place menu should have a properties entry.
    (lp: #846289)
  - add command line option to select file (lp: #575719)
  - Media in 'Places' side bar should have same context menu as in 
    'Computer' (lp: #230098)
* debian/nautilus-data.install:
  - updated, ui and icons have been moved into gresources
* debian/patches/05_desktop_menu_export.patch:
   - updated to correctly include the gresources desktop definition

[ Jeremy Bicha ]
* New upstream release.
* debian/control.in:
  - Bump minimum GTK and glib
* Refreshed patches
* Dropped upstream patches:
  - 17_dont_allow_new_tab_on_desktop.patch
  - 18_fix_crash_in_get_current_uri.patch
  - 19_lazily_initialize_notification_service.patch
  - git_sideplace_sorting.patch
  - git_next_row.patch
  - git_dont_document_browser_option.patch
  - git_browser_compat.patch
  - git_bookmarks_reordering.patch
  - git_listview_context_menus.patch
  - git_use_gtk_grid.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <gio/gio.h>
39
39
#include <gtk/gtk.h>
40
40
 
41
 
#define TAB_WIDTH_N_CHARS 15
42
 
 
43
41
#define AFTER_ALL_TABS -1
44
42
#define NOT_IN_APP_WINDOWS -2
45
43
 
46
 
#define INSANE_NUMBER_OF_URLS 20
47
 
 
48
44
static void nautilus_notebook_init               (NautilusNotebook *notebook);
49
45
static void nautilus_notebook_class_init         (NautilusNotebookClass *klass);
50
46
static int  nautilus_notebook_insert_page        (GtkNotebook *notebook,
99
95
static NautilusNotebook *
100
96
find_notebook_at_pointer (gint abs_x, gint abs_y)
101
97
{
 
98
        GdkDeviceManager *manager;
 
99
        GdkDevice *pointer;
102
100
        GdkWindow *win_at_pointer, *toplevel_win;
103
101
        gpointer toplevel = NULL;
104
102
        gint x, y;
105
103
 
106
104
        /* FIXME multi-head */
107
 
        win_at_pointer = gdk_window_at_pointer (&x, &y);
 
105
        manager = gdk_display_get_device_manager (gdk_display_get_default ());
 
106
        pointer = gdk_device_manager_get_client_pointer (manager);
 
107
        win_at_pointer = gdk_device_get_window_at_position (pointer, &x, &y);
 
108
 
108
109
        if (win_at_pointer == NULL)
109
110
        {
110
111
                /* We are outside all windows containing a notebook */
261
262
        g_return_if_fail (NAUTILUS_IS_NOTEBOOK (notebook));
262
263
        g_return_if_fail (NAUTILUS_IS_WINDOW_SLOT (slot));
263
264
 
264
 
        tab_label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (notebook), slot->content_box);
 
265
        tab_label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (notebook), 
 
266
                                                GTK_WIDGET (slot));
265
267
        g_return_if_fail (GTK_IS_WIDGET (tab_label));
266
268
 
267
269
        spinner = GTK_WIDGET (g_object_get_data (G_OBJECT (tab_label), "spinner"));
294
296
 
295
297
        g_return_if_fail (NAUTILUS_IS_NOTEBOOK (notebook));
296
298
        g_return_if_fail (NAUTILUS_IS_WINDOW_SLOT (slot));
297
 
        g_return_if_fail (GTK_IS_WIDGET (slot->content_box));
298
299
 
299
 
        hbox = gtk_notebook_get_tab_label (GTK_NOTEBOOK (notebook), slot->content_box);
 
300
        hbox = gtk_notebook_get_tab_label (GTK_NOTEBOOK (notebook), GTK_WIDGET (slot));
300
301
        g_return_if_fail (GTK_IS_WIDGET (hbox));
301
302
 
302
303
        label = GTK_WIDGET (g_object_get_data (G_OBJECT (hbox), "label"));
322
323
{
323
324
        GtkWidget *notebook;
324
325
 
325
 
        notebook = gtk_widget_get_ancestor (slot->content_box, NAUTILUS_TYPE_NOTEBOOK);
 
326
        notebook = gtk_widget_get_ancestor (GTK_WIDGET (slot), NAUTILUS_TYPE_NOTEBOOK);
326
327
        if (notebook != NULL) {
327
328
                g_signal_emit (notebook, signals[TAB_CLOSE_REQUEST], 0, slot);
328
329
        }
423
424
        tab_label = build_tab_label (notebook, slot);
424
425
 
425
426
        position = gtk_notebook_insert_page (GTK_NOTEBOOK (notebook),
426
 
                                             slot->content_box,
 
427
                                             GTK_WIDGET (slot),
427
428
                                             tab_label,
428
429
                                             position);
429
430
 
430
431
        gtk_container_child_set (GTK_CONTAINER (notebook),
431
 
                                 slot->content_box,
 
432
                                 GTK_WIDGET (slot),
432
433
                                 "tab-expand", TRUE,
433
434
                                 NULL);
434
435
 
439
440
        /* FIXME gtk bug! */
440
441
        /* FIXME: this should be fixed in gtk 2.12; check & remove this! */
441
442
        /* The signal handler may have reordered the tabs */
442
 
        position = gtk_notebook_page_num (gnotebook, slot->content_box);
 
443
        position = gtk_notebook_page_num (gnotebook, GTK_WIDGET (slot));
443
444
 
444
445
        if (jump_to)
445
446
        {