~ubuntu-branches/ubuntu/utopic/nautilus/utopic-proposed

« back to all changes in this revision

Viewing changes to .pc/15_use-ubuntu-help.patch/src/nautilus-application.c

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-01-02 16:50:06 UTC
  • mfrom: (1.17.43)
  • Revision ID: package-import@ubuntu.com-20140102165006-1ghk9ropzitdc8pp
Tags: 1:3.10.1-0ubuntu1
* New upstream release
* debian/control.in: bump depend on gtk+ 3.9.11
* debian/patches:
  - Dropped git patches, that are included in new version
  - 06_never_exec_nonexec_launchers.patch, refreshed
  - disconnect-extra-location-widgets.patch, dropped included in new version
  - 16_unity_new_documents.patch, refreshed
  - ubuntu_show_titlebar.patch, disable CSD titlebar on non-GNOME sessions
  - ubuntu_titlebar_css.patch, theme fixes (LP: #1272602)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include "nautilus-application.h"
32
32
 
33
 
#if ENABLE_EMPTY_VIEW
34
 
#include "nautilus-empty-view.h"
35
 
#endif /* ENABLE_EMPTY_VIEW */
36
 
 
37
33
#include "nautilus-bookmarks-window.h"
38
34
#include "nautilus-connect-server-dialog.h"
39
 
#include "nautilus-desktop-canvas-view.h"
40
35
#include "nautilus-desktop-window.h"
41
36
#include "nautilus-file-management-properties.h"
42
37
#include "nautilus-freedesktop-dbus.h"
43
 
#include "nautilus-canvas-view.h"
44
38
#include "nautilus-image-properties-page.h"
45
 
#include "nautilus-list-view.h"
46
39
#include "nautilus-previewer.h"
47
40
#include "nautilus-progress-ui-handler.h"
48
41
#include "nautilus-self-check-functions.h"
408
401
}
409
402
 
410
403
static GtkWidget *
411
 
get_desktop_manager_selection (GdkDisplay *display, int screen)
 
404
get_desktop_manager_selection (GdkScreen *screen)
412
405
{
413
406
        char selection_name[32];
414
407
        GdkAtom selection_atom;
415
408
        Window selection_owner;
 
409
        GdkDisplay *display;
416
410
        GtkWidget *selection_widget;
417
411
 
418
 
        g_snprintf (selection_name, sizeof (selection_name), "_NET_DESKTOP_MANAGER_S%d", screen);
 
412
        g_snprintf (selection_name, sizeof (selection_name),
 
413
                    "_NET_DESKTOP_MANAGER_S%d", gdk_screen_get_number (screen));
419
414
        selection_atom = gdk_atom_intern (selection_name, FALSE);
 
415
        display = gdk_screen_get_display (screen);
420
416
 
421
417
        selection_owner = XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display),
422
418
                                              gdk_x11_atom_to_xatom_for_display (display, 
425
421
                return NULL;
426
422
        }
427
423
        
428
 
        selection_widget = gtk_invisible_new_for_screen (gdk_display_get_screen (display, screen));
 
424
        selection_widget = gtk_invisible_new_for_screen (screen);
429
425
        /* We need this for gdk_x11_get_server_time() */
430
426
        gtk_widget_add_events (selection_widget, GDK_PROPERTY_CHANGE_MASK);
431
427
 
467
463
static void
468
464
nautilus_application_create_desktop_windows (NautilusApplication *application)
469
465
{
470
 
        GdkDisplay *display;
 
466
        GdkScreen *screen;
471
467
        NautilusDesktopWindow *window;
472
468
        GtkWidget *selection_widget;
473
 
        int screens, i;
474
 
 
475
 
        display = gdk_display_get_default ();
476
 
        screens = gdk_display_get_n_screens (display);
477
 
 
478
 
        for (i = 0; i < screens; i++) {
479
 
 
480
 
                DEBUG ("Creating a desktop window for screen %d", i);
 
469
 
 
470
        screen = gdk_screen_get_default ();
 
471
 
 
472
        DEBUG ("Creating desktop window");
481
473
                
482
 
                selection_widget = get_desktop_manager_selection (display, i);
483
 
                if (selection_widget != NULL) {
484
 
                        window = nautilus_desktop_window_new (GTK_APPLICATION (application),
485
 
                                                              gdk_display_get_screen (display, i));
486
 
 
487
 
                        g_signal_connect (selection_widget, "selection-clear-event",
488
 
                                          G_CALLBACK (selection_clear_event_cb), window);
489
 
                        
490
 
                        g_signal_connect (window, "unrealize",
491
 
                                          G_CALLBACK (desktop_unrealize_cb), selection_widget);
492
 
                        
493
 
                        /* We realize it immediately so that the NAUTILUS_DESKTOP_WINDOW_ID
494
 
                           property is set so gnome-settings-daemon doesn't try to set the
495
 
                           background. And we do a gdk_flush() to be sure X gets it. */
496
 
                        gtk_widget_realize (GTK_WIDGET (window));
497
 
                        gdk_flush ();
498
 
 
499
 
                        nautilus_application_desktop_windows =
500
 
                                g_list_prepend (nautilus_application_desktop_windows, window);
501
 
                }
 
474
        selection_widget = get_desktop_manager_selection (screen);
 
475
        if (selection_widget != NULL) {
 
476
                window = nautilus_desktop_window_new (GTK_APPLICATION (application), screen);
 
477
 
 
478
                g_signal_connect (selection_widget, "selection-clear-event",
 
479
                                  G_CALLBACK (selection_clear_event_cb), window);
 
480
 
 
481
                g_signal_connect (window, "unrealize",
 
482
                                  G_CALLBACK (desktop_unrealize_cb), selection_widget);
 
483
 
 
484
                /* We realize it immediately so that the NAUTILUS_DESKTOP_WINDOW_ID
 
485
                   property is set so gnome-settings-daemon doesn't try to set the
 
486
                   background. And we do a gdk_flush() to be sure X gets it. */
 
487
                gtk_widget_realize (GTK_WIDGET (window));
 
488
                gdk_flush ();
 
489
 
 
490
                nautilus_application_desktop_windows =
 
491
                        g_list_prepend (nautilus_application_desktop_windows, window);
502
492
        }
503
493
}
504
494
 
1380
1370
        /* Initialize the desktop link monitor singleton */
1381
1371
        nautilus_desktop_link_monitor_get ();
1382
1372
 
1383
 
        if (nautilus_application_desktop_windows == NULL) {
1384
 
                nautilus_application_create_desktop_windows (application);
1385
 
        }
 
1373
        nautilus_application_create_desktop_windows (application);
1386
1374
}
1387
1375
 
1388
1376
static void
1389
1377
nautilus_application_close_desktop (void)
1390
1378
{
1391
 
        if (nautilus_application_desktop_windows != NULL) {
1392
 
                g_list_foreach (nautilus_application_desktop_windows,
1393
 
                                (GFunc) gtk_widget_destroy, NULL);
1394
 
                g_list_free (nautilus_application_desktop_windows);
1395
 
                nautilus_application_desktop_windows = NULL;
1396
 
        }
 
1379
        g_list_foreach (nautilus_application_desktop_windows,
 
1380
                        (GFunc) gtk_widget_destroy, NULL);
 
1381
        g_list_free (nautilus_application_desktop_windows);
 
1382
        nautilus_application_desktop_windows = NULL;
 
1383
 
1397
1384
        nautilus_desktop_link_monitor_shutdown ();
1398
1385
}
1399
1386
 
1606
1593
        /* initialize preferences and create the global GSettings objects */
1607
1594
        nautilus_global_preferences_init ();
1608
1595
 
1609
 
        /* register views */
1610
 
        nautilus_profile_start ("Register views");
1611
 
        nautilus_canvas_view_register ();
1612
 
        nautilus_desktop_canvas_view_register ();
1613
 
        nautilus_list_view_register ();
1614
 
#if ENABLE_EMPTY_VIEW
1615
 
        nautilus_empty_view_register ();
1616
 
#endif
1617
 
        nautilus_profile_end ("Register views");
1618
 
 
1619
1596
        /* register property pages */
1620
1597
        nautilus_image_properties_page_register ();
1621
1598