diff --git a/libgnome-desktop/gnome-bg.c b/libgnome-desktop/gnome-bg.c
index 47493d2..822231a 100644
--- a/libgnome-desktop/gnome-bg.c
+++ b/libgnome-desktop/gnome-bg.c
@@ -1277,7 +1277,7 @@ gnome_bg_get_pixmap_from_root (GdkScreen *screen)
 	if (data != NULL) {
 		gdk_error_trap_push ();
 		source_pixmap = gdk_pixmap_foreign_new (*(Pixmap *) data);
-		gdk_error_trap_pop ();
+		gdk_error_trap_pop_ignored ();
 
 		if (source_pixmap != NULL) {
 			gdk_drawable_set_colormap (source_pixmap,
@@ -1350,8 +1350,7 @@ gnome_bg_set_root_pixmap_id (GdkScreen *screen,
 		    nitems == 1) {
 			gdk_error_trap_push ();
 			XKillClient (display, *(Pixmap *)data_esetroot);
-			gdk_flush ();
-			gdk_error_trap_pop ();
+			gdk_error_trap_pop_ignored ();
 		}
 		XFree (data_esetroot);
 	}
