[murrine/gtk+3] Ported RGBA widget check in gtk+ 3.0, hope it'll work



commit 596f17a0bbf58d0abbc82f8ea541dd950fb42266
Author: Andrea Cimitan <andrea cimitan gmail com>
Date:   Wed Oct 13 19:16:51 2010 +0200

    Ported RGBA widget check in gtk+ 3.0, hope it'll work

 src/murrine_style.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/src/murrine_style.c b/src/murrine_style.c
index 696c7d2..6125297 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -75,12 +75,21 @@ boolean murrine_widget_is_rgba (GtkWidget *widget)
 #ifdef HAVE_RGBA
 	if (gdk_screen_is_composited(screen))
 	{
-	/* XXX RGBA is disabled for the moment */
-/*		GdkVisual *visual = gtk_widget_get_visual (widget);*/
-/*		if (gdk_visual_get_depth (visual) == 32 && (visual->red_mask   == 0xff0000 &&*/
-/*		                            visual->green_mask == 0x00ff00 &&*/
-/*		                            visual->blue_mask  == 0x0000ff))*/
-			use_rgba = FALSE;
+		GdkVisual *visual;
+		guint32 *red_mask;
+		guint32 *green_mask;
+		guint32 *blue_mask;
+
+		visual = gtk_widget_get_visual (widget);
+
+		gdk_visual_get_red_pixel_details (visual, red_mask, NULL, NULL);
+		gdk_visual_get_green_pixel_details (visual, green_mask, NULL, NULL);
+		gdk_visual_get_blue_pixel_details (visual, blue_mask, NULL, NULL);
+
+		if (gdk_visual_get_depth (visual) == 32 && (red_mask == 0xff0000 &&
+		                                            green_mask == 0x00ff00 &&
+		                                            blue_mask  == 0x0000ff))
+			use_rgba = TRUE;
 	}
 #endif
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]