[nautilus] Use an RGBA window for the desktop
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Use an RGBA window for the desktop
- Date: Wed, 20 Feb 2013 04:50:01 +0000 (UTC)
commit f0f36c876e4810b190a82e3a953d9263c106447f
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Feb 19 11:24:24 2013 -0500
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(+), 0 deletions(-)
---
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
g_signal_connect_object (canvas_container, "middle-click",
G_CALLBACK (nautilus_desktop_canvas_view_handle_middle_click),
desktop_canvas_view, 0);
+ 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]