changeset 32692:1eba1701b355

Render the DND hint windows using the new window's colourmap instead of trying to force a colourmap on the window.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 09 Oct 2011 05:37:17 +0000
parents e71b9033d9f5
children c9b09afd79e7
files pidgin/gtkdnd-hints.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkdnd-hints.c	Sun Oct 09 05:03:55 2011 +0000
+++ b/pidgin/gtkdnd-hints.c	Sun Oct 09 05:37:17 2011 +0000
@@ -62,19 +62,20 @@
 	GdkBitmap *bitmap;
 	GtkWidget *pix;
 	GtkWidget *win;
+	GdkColormap *colormap;
 
 	pixbuf = gdk_pixbuf_new_from_file(fname, NULL);
 	g_return_val_if_fail(pixbuf, NULL);
 
-	gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap, &bitmap, 128);
+	win = gtk_window_new(GTK_WINDOW_POPUP);
+	colormap = gtk_widget_get_colormap(win);
+	gdk_pixbuf_render_pixmap_and_mask_for_colormap(pixbuf, colormap,
+	                                               &pixmap, &bitmap, 128);
 	g_object_unref(G_OBJECT(pixbuf));
 
-	gtk_widget_push_colormap(gdk_rgb_get_colormap());
-	win = gtk_window_new(GTK_WINDOW_POPUP);
 	pix = gtk_image_new_from_pixmap(pixmap, bitmap);
 	gtk_container_add(GTK_CONTAINER(win), pix);
 	gtk_widget_shape_combine_mask(win, bitmap, 0, 0);
-	gtk_widget_pop_colormap();
 
 	g_object_unref(G_OBJECT(pixmap));
 	g_object_unref(G_OBJECT(bitmap));