summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2003-06-16 13:05:13 +0000
committerMark McLoughlin <markmc@src.gnome.org>2003-06-16 13:05:13 +0000
commitbe87303ef29cded9f8ab21950ab8d017d099dd0e (patch)
treef67be0768a84959993e1cba912b40a8735133758
parent8ba4847252f5fb5a500b1ee1d51eb2928289f02e (diff)
downloadnautilus-be87303ef29cded9f8ab21950ab8d017d099dd0e.tar.gz
create a 1x1 pixmap with the background colour and set _XROOTPMAP_ID when
2003-06-15 Mark McLoughlin <mark@skynet.ie> * libnautilus-private/nautilus-directory-background.c: (image_loading_done_callback): create a 1x1 pixmap with the background colour and set _XROOTPMAP_ID when we have a solid colour background. Fixes panel translucency with solid colour backgrounds.
-rw-r--r--ChangeLog8
-rw-r--r--libnautilus-private/nautilus-directory-background.c73
2 files changed, 23 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index a07ef04da..554c6bb51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-06-15 Mark McLoughlin <mark@skynet.ie>
+
+ * libnautilus-private/nautilus-directory-background.c:
+ (image_loading_done_callback): create a 1x1 pixmap with
+ the background colour and set _XROOTPMAP_ID when we have
+ a solid colour background. Fixes panel translucency with
+ solid colour backgrounds.
+
2003-06-16 Taneem Ahmed <taneem@eyetap.org>
* configure.in: Added "bn" to ALL_LINGUAS.
diff --git a/libnautilus-private/nautilus-directory-background.c b/libnautilus-private/nautilus-directory-background.c
index 799ea8924..75858fd9d 100644
--- a/libnautilus-private/nautilus-directory-background.c
+++ b/libnautilus-private/nautilus-directory-background.c
@@ -488,49 +488,6 @@ set_root_pixmap (GdkPixmap *pixmap, GdkScreen *screen)
/* Free the root pixmap */
static void
-free_root_pixmap (GdkScreen *screen)
-{
- gulong nitems;
- Atom type;
- gint format;
- int result;
- int screen_num;
- guchar *data_esetroot;
- gulong bytes_after;
- Display *display;
-
- screen_num = gdk_screen_get_number (screen);
- display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
- data_esetroot = NULL;
-
- XGrabServer (display);
-
- result = XGetWindowProperty (display, RootWindow (display, screen_num),
- gdk_x11_get_xatom_by_name ("ESETROOT_PMAP_ID"),
- 0L, 1L, False, XA_PIXMAP,
- &type, &format, &nitems, &bytes_after,
- &data_esetroot);
-
- if (data_esetroot != NULL) {
- if (result == Success && type == XA_PIXMAP && format == 32 && nitems == 1) {
- gdk_error_trap_push ();
- XKillClient (display, *(Pixmap *)data_esetroot);
- gdk_flush ();
- gdk_error_trap_pop ();
- }
- XFree (data_esetroot);
- }
-
- XDeleteProperty (display, RootWindow (display, screen_num),
- gdk_x11_get_xatom_by_name ("ESETROOT_PMAP_ID"));
- XDeleteProperty (display, RootWindow (display, screen_num),
- gdk_x11_get_xatom_by_name ("_XROOTPMAP_ID"));
-
- XUngrabServer (display);
- XFlush (display);
-}
-
-static void
image_loading_done_callback (EelBackground *background, gboolean successful_load, void *disconnect_signal)
{
int entire_width;
@@ -568,22 +525,9 @@ image_loading_done_callback (EelBackground *background, gboolean successful_load
GINT_TO_POINTER (TRUE));
return;
}
-
- pixmap = make_root_pixmap (screen, pixmap_width, pixmap_height);
- if (pixmap == NULL) {
- return;
- }
-
- gc = gdk_gc_new (pixmap);
- eel_background_draw (background, pixmap, gc,
- 0, 0, 0, 0,
- pixmap_width, pixmap_height);
- g_object_unref (gc);
- set_root_pixmap (pixmap, screen);
- g_object_unref (pixmap);
-
} else {
- free_root_pixmap (screen);
+ pixmap_width = pixmap_height = 1;
+
background_window = gdk_screen_get_root_window (screen);
color_string = eel_background_get_color (background);
@@ -594,6 +538,19 @@ image_loading_done_callback (EelBackground *background, gboolean successful_load
}
}
}
+
+ pixmap = make_root_pixmap (screen, pixmap_width, pixmap_height);
+ if (pixmap == NULL) {
+ return;
+ }
+
+ gc = gdk_gc_new (pixmap);
+ eel_background_draw (background, pixmap, gc,
+ 0, 0, 0, 0,
+ pixmap_width, pixmap_height);
+ g_object_unref (gc);
+ set_root_pixmap (pixmap, screen);
+ g_object_unref (pixmap);
}
static void