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

« back to all changes in this revision

Viewing changes to .pc/12_unity_launcher_support.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"
404
397
}
405
398
 
406
399
static GtkWidget *
407
 
get_desktop_manager_selection (GdkDisplay *display, int screen)
 
400
get_desktop_manager_selection (GdkScreen *screen)
408
401
{
409
402
        char selection_name[32];
410
403
        GdkAtom selection_atom;
411
404
        Window selection_owner;
 
405
        GdkDisplay *display;
412
406
        GtkWidget *selection_widget;
413
407
 
414
 
        g_snprintf (selection_name, sizeof (selection_name), "_NET_DESKTOP_MANAGER_S%d", screen);
 
408
        g_snprintf (selection_name, sizeof (selection_name),
 
409
                    "_NET_DESKTOP_MANAGER_S%d", gdk_screen_get_number (screen));
415
410
        selection_atom = gdk_atom_intern (selection_name, FALSE);
 
411
        display = gdk_screen_get_display (screen);
416
412
 
417
413
        selection_owner = XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display),
418
414
                                              gdk_x11_atom_to_xatom_for_display (display, 
421
417
                return NULL;
422
418
        }
423
419
        
424
 
        selection_widget = gtk_invisible_new_for_screen (gdk_display_get_screen (display, screen));
 
420
        selection_widget = gtk_invisible_new_for_screen (screen);
425
421
        /* We need this for gdk_x11_get_server_time() */
426
422
        gtk_widget_add_events (selection_widget, GDK_PROPERTY_CHANGE_MASK);
427
423
 
463
459
static void
464
460
nautilus_application_create_desktop_windows (NautilusApplication *application)
465
461
{
466
 
        GdkDisplay *display;
 
462
        GdkScreen *screen;
467
463
        NautilusDesktopWindow *window;
468
464
        GtkWidget *selection_widget;
469
 
        int screens, i;
470
 
 
471
 
        display = gdk_display_get_default ();
472
 
        screens = gdk_display_get_n_screens (display);
473
 
 
474
 
        for (i = 0; i < screens; i++) {
475
 
 
476
 
                DEBUG ("Creating a desktop window for screen %d", i);
 
465
 
 
466
        screen = gdk_screen_get_default ();
 
467
 
 
468
        DEBUG ("Creating desktop window");
477
469
                
478
 
                selection_widget = get_desktop_manager_selection (display, i);
479
 
                if (selection_widget != NULL) {
480
 
                        window = nautilus_desktop_window_new (GTK_APPLICATION (application),
481
 
                                                              gdk_display_get_screen (display, i));
482
 
 
483
 
                        g_signal_connect (selection_widget, "selection-clear-event",
484
 
                                          G_CALLBACK (selection_clear_event_cb), window);
485
 
                        
486
 
                        g_signal_connect (window, "unrealize",
487
 
                                          G_CALLBACK (desktop_unrealize_cb), selection_widget);
488
 
                        
489
 
                        /* We realize it immediately so that the NAUTILUS_DESKTOP_WINDOW_ID
490
 
                           property is set so gnome-settings-daemon doesn't try to set the
491
 
                           background. And we do a gdk_flush() to be sure X gets it. */
492
 
                        gtk_widget_realize (GTK_WIDGET (window));
493
 
                        gdk_flush ();
494
 
 
495
 
                        nautilus_application_desktop_windows =
496
 
                                g_list_prepend (nautilus_application_desktop_windows, window);
497
 
                }
 
470
        selection_widget = get_desktop_manager_selection (screen);
 
471
        if (selection_widget != NULL) {
 
472
                window = nautilus_desktop_window_new (GTK_APPLICATION (application), screen);
 
473
 
 
474
                g_signal_connect (selection_widget, "selection-clear-event",
 
475
                                  G_CALLBACK (selection_clear_event_cb), window);
 
476
 
 
477
                g_signal_connect (window, "unrealize",
 
478
                                  G_CALLBACK (desktop_unrealize_cb), selection_widget);
 
479
 
 
480
                /* We realize it immediately so that the NAUTILUS_DESKTOP_WINDOW_ID
 
481
                   property is set so gnome-settings-daemon doesn't try to set the
 
482
                   background. And we do a gdk_flush() to be sure X gets it. */
 
483
                gtk_widget_realize (GTK_WIDGET (window));
 
484
                gdk_flush ();
 
485
 
 
486
                nautilus_application_desktop_windows =
 
487
                        g_list_prepend (nautilus_application_desktop_windows, window);
498
488
        }
499
489
}
500
490
 
1376
1366
        /* Initialize the desktop link monitor singleton */
1377
1367
        nautilus_desktop_link_monitor_get ();
1378
1368
 
1379
 
        if (nautilus_application_desktop_windows == NULL) {
1380
 
                nautilus_application_create_desktop_windows (application);
1381
 
        }
 
1369
        nautilus_application_create_desktop_windows (application);
1382
1370
}
1383
1371
 
1384
1372
static void
1385
1373
nautilus_application_close_desktop (void)
1386
1374
{
1387
 
        if (nautilus_application_desktop_windows != NULL) {
1388
 
                g_list_foreach (nautilus_application_desktop_windows,
1389
 
                                (GFunc) gtk_widget_destroy, NULL);
1390
 
                g_list_free (nautilus_application_desktop_windows);
1391
 
                nautilus_application_desktop_windows = NULL;
1392
 
        }
 
1375
        g_list_foreach (nautilus_application_desktop_windows,
 
1376
                        (GFunc) gtk_widget_destroy, NULL);
 
1377
        g_list_free (nautilus_application_desktop_windows);
 
1378
        nautilus_application_desktop_windows = NULL;
 
1379
 
1393
1380
        nautilus_desktop_link_monitor_shutdown ();
1394
1381
}
1395
1382
 
1602
1589
        /* initialize preferences and create the global GSettings objects */
1603
1590
        nautilus_global_preferences_init ();
1604
1591
 
1605
 
        /* register views */
1606
 
        nautilus_profile_start ("Register views");
1607
 
        nautilus_canvas_view_register ();
1608
 
        nautilus_desktop_canvas_view_register ();
1609
 
        nautilus_list_view_register ();
1610
 
#if ENABLE_EMPTY_VIEW
1611
 
        nautilus_empty_view_register ();
1612
 
#endif
1613
 
        nautilus_profile_end ("Register views");
1614
 
 
1615
1592
        /* register property pages */
1616
1593
        nautilus_image_properties_page_register ();
1617
1594