This repository has been archived by the owner on Feb 27, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nautilus-ubuntu] Revert commits that drop background drawing support
- Loading branch information
Xiao-Long Chen
committed
Apr 24, 2013
1 parent
89ca5f7
commit c4faa70
Showing
6 changed files
with
1,039 additions
and
3 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
nautilus-ubuntu/0001-Use-an-RGBA-window-for-the-desktop.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
From f0f36c876e4810b190a82e3a953d9263c106447f Mon Sep 17 00:00:00 2001 | ||
From: Matthias Clasen <mclasen@redhat.com> | ||
Date: Tue, 19 Feb 2013 11:24:24 -0500 | ||
Subject: [PATCH 1/5] Use an RGBA window for the desktop | ||
|
||
In the future, GNOME shell will always render the background, | ||
and handle transitions, etc. Nautilus will then just render | ||
its icons on top. | ||
--- | ||
src/nautilus-desktop-canvas-view.c | 14 ++++++++++++++ | ||
src/nautilus-desktop-window.c | 6 ++++++ | ||
2 files changed, 20 insertions(+) | ||
|
||
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c | ||
index 4d7c362..340ed35 100644 | ||
--- a/src/nautilus-desktop-canvas-view.c | ||
+++ b/src/nautilus-desktop-canvas-view.c | ||
@@ -417,6 +417,17 @@ realized_callback (GtkWidget *widget, NautilusDesktopCanvasView *desktop_canvas_ | ||
desktop_canvas_view); | ||
} | ||
|
||
+static void | ||
+desktop_canvas_container_realize (GtkWidget *widget, | ||
+ NautilusDesktopCanvasView *desktop_canvas_view) | ||
+{ | ||
+ GdkWindow *bin_window; | ||
+ GdkRGBA transparent = { 0, 0, 0, 0 }; | ||
+ | ||
+ bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); | ||
+ gdk_window_set_background_rgba (bin_window, &transparent); | ||
+} | ||
+ | ||
static NautilusZoomLevel | ||
get_default_zoom_level (void) | ||
{ | ||
@@ -584,6 +595,9 @@ nautilus_desktop_canvas_view_init (NautilusDesktopCanvasView *desktop_canvas_vie | ||
nautilus_view_set_show_foreign (NAUTILUS_VIEW (desktop_canvas_view), | ||
FALSE); | ||
|
||
+ g_signal_connect_object (canvas_container, "realize", | ||
+ G_CALLBACK (desktop_canvas_container_realize), desktop_canvas_view, 0); | ||
+ | ||
g_signal_connect_object (desktop_canvas_view, "realize", | ||
G_CALLBACK (realized_callback), desktop_canvas_view, 0); | ||
g_signal_connect_object (desktop_canvas_view, "unrealize", | ||
diff --git a/src/nautilus-desktop-window.c b/src/nautilus-desktop-window.c | ||
index 8b64d55..b39b16e 100644 | ||
--- a/src/nautilus-desktop-window.c | ||
+++ b/src/nautilus-desktop-window.c | ||
@@ -234,6 +234,7 @@ realize (GtkWidget *widget) | ||
{ | ||
NautilusDesktopWindow *window; | ||
NautilusDesktopWindowDetails *details; | ||
+ GdkVisual *visual; | ||
|
||
window = NAUTILUS_DESKTOP_WINDOW (widget); | ||
details = window->details; | ||
@@ -242,6 +243,11 @@ realize (GtkWidget *widget) | ||
gtk_widget_set_events (widget, gtk_widget_get_events (widget) | ||
| GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); | ||
|
||
+ visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)); | ||
+ if (visual) { | ||
+ gtk_widget_set_visual (widget, visual); | ||
+ } | ||
+ | ||
/* Do the work of realizing. */ | ||
GTK_WIDGET_CLASS (nautilus_desktop_window_parent_class)->realize (widget); | ||
|
||
-- | ||
1.8.1.2 | ||
|
73 changes: 73 additions & 0 deletions
73
nautilus-ubuntu/0002-desktop-window-don-t-signal-we-are-handling-the-back.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
From 9f99ba3506d5cf1584d9afa952e11aed17deac2f Mon Sep 17 00:00:00 2001 | ||
From: Cosimo Cecchi <cosimoc@gnome.org> | ||
Date: Tue, 19 Feb 2013 11:26:15 -0500 | ||
Subject: [PATCH 2/5] desktop-window: don't signal we are handling the | ||
background | ||
|
||
g-s-d won't listen to this root window property anymore, and we're not | ||
actually rendering any background now. Don't set it. | ||
--- | ||
src/nautilus-desktop-window.c | 29 ----------------------------- | ||
1 file changed, 29 deletions(-) | ||
|
||
diff --git a/src/nautilus-desktop-window.c b/src/nautilus-desktop-window.c | ||
index b39b16e..d99e9fb 100644 | ||
--- a/src/nautilus-desktop-window.c | ||
+++ b/src/nautilus-desktop-window.c | ||
@@ -176,17 +176,10 @@ unrealize (GtkWidget *widget) | ||
{ | ||
NautilusDesktopWindow *window; | ||
NautilusDesktopWindowDetails *details; | ||
- GdkWindow *root_window; | ||
|
||
window = NAUTILUS_DESKTOP_WINDOW (widget); | ||
details = window->details; | ||
|
||
- root_window = gdk_screen_get_root_window ( | ||
- gtk_window_get_screen (GTK_WINDOW (window))); | ||
- | ||
- gdk_property_delete (root_window, | ||
- gdk_atom_intern ("NAUTILUS_DESKTOP_WINDOW_ID", TRUE)); | ||
- | ||
if (details->size_changed_id != 0) { | ||
g_signal_handler_disconnect (gtk_window_get_screen (GTK_WINDOW (window)), | ||
details->size_changed_id); | ||
@@ -210,26 +203,6 @@ set_wmspec_desktop_hint (GdkWindow *window) | ||
} | ||
|
||
static void | ||
-set_desktop_window_id (NautilusDesktopWindow *window, | ||
- GdkWindow *gdkwindow) | ||
-{ | ||
- /* Tuck the desktop windows xid in the root to indicate we own the desktop. | ||
- */ | ||
- Window window_xid; | ||
- GdkWindow *root_window; | ||
- | ||
- root_window = gdk_screen_get_root_window ( | ||
- gtk_window_get_screen (GTK_WINDOW (window))); | ||
- | ||
- window_xid = GDK_WINDOW_XID (gdkwindow); | ||
- | ||
- gdk_property_change (root_window, | ||
- gdk_atom_intern ("NAUTILUS_DESKTOP_WINDOW_ID", FALSE), | ||
- gdk_x11_xatom_to_atom (XA_WINDOW), 32, | ||
- GDK_PROP_MODE_REPLACE, (guchar *) &window_xid, 1); | ||
-} | ||
- | ||
-static void | ||
realize (GtkWidget *widget) | ||
{ | ||
NautilusDesktopWindow *window; | ||
@@ -254,8 +227,6 @@ realize (GtkWidget *widget) | ||
/* This is the new way to set up the desktop window */ | ||
set_wmspec_desktop_hint (gtk_widget_get_window (widget)); | ||
|
||
- set_desktop_window_id (window, gtk_widget_get_window (widget)); | ||
- | ||
details->size_changed_id = | ||
g_signal_connect (gtk_window_get_screen (GTK_WINDOW (window)), "size-changed", | ||
G_CALLBACK (nautilus_desktop_window_screen_size_changed), window); | ||
-- | ||
1.8.1.2 | ||
|
86 changes: 86 additions & 0 deletions
86
nautilus-ubuntu/0003-canvas-dnd-don-t-use-NautilusDesktopBackground.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
From 8b4a83ea80bf657cd8be754786e5f9daf7d5cc52 Mon Sep 17 00:00:00 2001 | ||
From: Cosimo Cecchi <cosimoc@gnome.org> | ||
Date: Tue, 19 Feb 2013 11:28:52 -0500 | ||
Subject: [PATCH 3/5] canvas-dnd: don't use NautilusDesktopBackground | ||
|
||
We only use it for DnD when receiving an image drop. We can copy that | ||
code from NautilusDesktopBackground in a helper function. | ||
--- | ||
libnautilus-private/nautilus-canvas-dnd.c | 39 ++++++++++++++++++++++++------- | ||
1 file changed, 30 insertions(+), 9 deletions(-) | ||
|
||
diff --git a/libnautilus-private/nautilus-canvas-dnd.c b/libnautilus-private/nautilus-canvas-dnd.c | ||
index 2d1ae24..4be79bd 100644 | ||
--- a/libnautilus-private/nautilus-canvas-dnd.c | ||
+++ b/libnautilus-private/nautilus-canvas-dnd.c | ||
@@ -37,6 +37,7 @@ | ||
|
||
#include "nautilus-file-dnd.h" | ||
#include "nautilus-canvas-private.h" | ||
+#include "nautilus-global-preferences.h" | ||
#include "nautilus-link.h" | ||
#include "nautilus-metadata.h" | ||
#include "nautilus-selection-canvas-item.h" | ||
@@ -51,8 +52,10 @@ | ||
#include <gdk/gdkx.h> | ||
#include <gtk/gtk.h> | ||
#include <glib/gi18n.h> | ||
+#define GNOME_DESKTOP_USE_UNSTABLE_API | ||
+#include <libgnome-desktop/gnome-bg.h> | ||
+#include <gdesktop-enums.h> | ||
|
||
-#include <libnautilus-private/nautilus-desktop-background.h> | ||
#include <libnautilus-private/nautilus-file-utilities.h> | ||
#include <libnautilus-private/nautilus-file-changes-queue.h> | ||
#include <stdio.h> | ||
@@ -1040,6 +1043,30 @@ selection_is_image_file (GList *selection_list) | ||
return result; | ||
} | ||
|
||
+static void | ||
+receive_dropped_background_image (const gchar *image_uri) | ||
+{ | ||
+ GnomeBG *bg; | ||
+ char *filename; | ||
+ | ||
+ if (image_uri != NULL) { | ||
+ filename = g_filename_from_uri (image_uri, NULL, NULL); | ||
+ } else { | ||
+ filename = NULL; | ||
+ } | ||
+ | ||
+ bg = gnome_bg_new (); | ||
+ | ||
+ /* Currently, we only support tiled images. So we set the placement. | ||
+ */ | ||
+ gnome_bg_set_placement (bg, G_DESKTOP_BACKGROUND_STYLE_WALLPAPER); | ||
+ gnome_bg_set_filename (bg, filename); | ||
+ | ||
+ gnome_bg_save_to_preferences (bg, gnome_background_preferences); | ||
+ | ||
+ g_free (filename); | ||
+ g_object_unref (bg); | ||
+} | ||
|
||
static void | ||
nautilus_canvas_container_receive_dropped_icons (NautilusCanvasContainer *container, | ||
@@ -1083,15 +1110,8 @@ nautilus_canvas_container_receive_dropped_icons (NautilusCanvasContainer *contai | ||
} | ||
|
||
if (real_action == (GdkDragAction) NAUTILUS_DND_ACTION_SET_AS_BACKGROUND) { | ||
- NautilusDesktopBackground *background; | ||
- | ||
- background = nautilus_desktop_background_new (container); | ||
selected_item = container->details->dnd_info->drag_info.selection_list->data; | ||
- | ||
- nautilus_desktop_background_receive_dropped_background_image (background, | ||
- selected_item->uri); | ||
- | ||
- g_object_unref (background); | ||
+ receive_dropped_background_image (selected_item->uri); | ||
|
||
return; | ||
} | ||
-- | ||
1.8.1.2 | ||
|
77 changes: 77 additions & 0 deletions
77
nautilus-ubuntu/0004-desktop-canvas-don-t-use-NautilusDesktopBacgrkound.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
From 07d2ca86237fac8b5bddc4e619e43dfc813bc5e7 Mon Sep 17 00:00:00 2001 | ||
From: Cosimo Cecchi <cosimoc@gnome.org> | ||
Date: Tue, 19 Feb 2013 11:29:59 -0500 | ||
Subject: [PATCH 4/5] desktop-canvas: don't use NautilusDesktopBacgrkound | ||
|
||
We don't need to anymore. | ||
--- | ||
src/nautilus-desktop-canvas-view.c | 25 ------------------------- | ||
1 file changed, 25 deletions(-) | ||
|
||
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c | ||
index 340ed35..28cbd3b 100644 | ||
--- a/src/nautilus-desktop-canvas-view.c | ||
+++ b/src/nautilus-desktop-canvas-view.c | ||
@@ -41,7 +41,6 @@ | ||
#include <fcntl.h> | ||
#include <gdk/gdkx.h> | ||
#include <glib/gi18n.h> | ||
-#include <libnautilus-private/nautilus-desktop-background.h> | ||
#include <libnautilus-private/nautilus-desktop-icon-file.h> | ||
#include <libnautilus-private/nautilus-directory-notify.h> | ||
#include <libnautilus-private/nautilus-file-changes-queue.h> | ||
@@ -76,8 +75,6 @@ struct NautilusDesktopCanvasViewDetails | ||
gulong delayed_init_signal; | ||
guint reload_desktop_timeout; | ||
gboolean pending_rescan; | ||
- | ||
- NautilusDesktopBackground *background; | ||
}; | ||
|
||
static void default_zoom_level_changed (gpointer user_data); | ||
@@ -234,22 +231,6 @@ desktop_canvas_view_property_filter (GdkXEvent *gdk_xevent, | ||
return GDK_FILTER_CONTINUE; | ||
} | ||
|
||
-static void | ||
-real_begin_loading (NautilusView *object) | ||
-{ | ||
- NautilusCanvasContainer *canvas_container; | ||
- NautilusDesktopCanvasView *view; | ||
- | ||
- view = NAUTILUS_DESKTOP_CANVAS_VIEW (object); | ||
- | ||
- canvas_container = get_canvas_container (view); | ||
- if (view->details->background == NULL) { | ||
- view->details->background = nautilus_desktop_background_new (canvas_container); | ||
- } | ||
- | ||
- NAUTILUS_VIEW_CLASS (nautilus_desktop_canvas_view_parent_class)->begin_loading (object); | ||
-} | ||
- | ||
static const char * | ||
real_get_id (NautilusView *view) | ||
{ | ||
@@ -287,11 +268,6 @@ nautilus_desktop_canvas_view_dispose (GObject *object) | ||
nautilus_view_update_menus, | ||
canvas_view); | ||
|
||
- if (canvas_view->details->background != NULL) { | ||
- g_object_unref (canvas_view->details->background); | ||
- canvas_view->details->background = NULL; | ||
- } | ||
- | ||
G_OBJECT_CLASS (nautilus_desktop_canvas_view_parent_class)->dispose (object); | ||
} | ||
|
||
@@ -304,7 +280,6 @@ nautilus_desktop_canvas_view_class_init (NautilusDesktopCanvasViewClass *class) | ||
|
||
G_OBJECT_CLASS (class)->dispose = nautilus_desktop_canvas_view_dispose; | ||
|
||
- vclass->begin_loading = real_begin_loading; | ||
vclass->merge_menus = real_merge_menus; | ||
vclass->update_menus = real_update_menus; | ||
vclass->get_view_id = real_get_id; | ||
-- | ||
1.8.1.2 | ||
|
Oops, something went wrong.