Ejemplo n.º 1
0
static void
nautilus_application_create_desktop_windows (NautilusApplication *application)
{
	GdkScreen *screen;
	NautilusDesktopWindow *window;
	GtkWidget *selection_widget;

	screen = gdk_screen_get_default ();

	DEBUG ("Creating desktop window");
		
	selection_widget = get_desktop_manager_selection (screen);
	if (selection_widget != NULL) {
		window = nautilus_desktop_window_new (GTK_APPLICATION (application), screen);

		g_signal_connect (selection_widget, "selection-clear-event",
				  G_CALLBACK (selection_clear_event_cb), window);

		g_signal_connect (window, "unrealize",
				  G_CALLBACK (desktop_unrealize_cb), selection_widget);

		/* We realize it immediately so that the NAUTILUS_DESKTOP_WINDOW_ID
		   property is set so gnome-settings-daemon doesn't try to set the
		   background. And we do a gdk_flush() to be sure X gets it. */
		gtk_widget_realize (GTK_WIDGET (window));
		gdk_flush ();

		nautilus_application_desktop_windows =
			g_list_prepend (nautilus_application_desktop_windows, window);
	}
}
Ejemplo n.º 2
0
static void
nemo_application_create_desktop_windows (NemoApplication *application)
{
	GdkDisplay *display;
	NemoDesktopWindow *window;
	GtkWidget *selection_widget;
	int screens, i;

	display = gdk_display_get_default ();
	screens = gdk_display_get_n_screens (display);

	for (i = 0; i < screens; i++) {

		DEBUG ("Creating a desktop window for screen %d", i);
		
		selection_widget = get_desktop_manager_selection (display, i);
		if (selection_widget != NULL) {
			window = nemo_desktop_window_new (gdk_display_get_screen (display, i));

			g_signal_connect (selection_widget, "selection_clear_event",
					  G_CALLBACK (selection_clear_event_cb), window);
			
			g_signal_connect (window, "unrealize",
					  G_CALLBACK (desktop_unrealize_cb), selection_widget);
			
			/* We realize it immediately so that the NEMO_DESKTOP_WINDOW_ID
			   property is set so gnome-settings-daemon doesn't try to set the
			   background. And we do a gdk_flush() to be sure X gets it. */
			gtk_widget_realize (GTK_WIDGET (window));
			gdk_flush ();

			nemo_application_desktop_windows =
				g_list_prepend (nemo_application_desktop_windows, window);

			gtk_application_add_window (GTK_APPLICATION (application),
						    GTK_WINDOW (window));
		}
	}
}