[gnome-shell] Replace deprecated GDK symbols



commit a45021bd6018e1e401d8075ce7b211b6e1ffd079
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jun 26 21:47:26 2010 +0200

    Replace deprecated GDK symbols
    
    The fix depends on API introduced in this cycle, so the required
    GTK+ version is bumped to 2.21.1.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=621845

 configure.ac             |    2 +-
 src/shell-tray-manager.c |    2 +-
 src/tray/na-tray-child.c |    7 ++++++-
 3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 50fb9a0..35935a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,7 @@ CLUTTER_MIN_VERSION=1.2.8
 GOBJECT_INTROSPECTION_MIN_VERSION=0.6.11
 GJS_MIN_VERSION=0.7
 MUTTER_MIN_VERSION=2.31.4
-GTK_MIN_VERSION=2.18.0
+GTK_MIN_VERSION=2.21.1
 GIO_MIN_VERSION=2.25.9
 
 # Collect more than 20 libraries for a prize!
diff --git a/src/shell-tray-manager.c b/src/shell-tray-manager.c
index d359c23..b047395 100644
--- a/src/shell-tray-manager.c
+++ b/src/shell-tray-manager.c
@@ -235,7 +235,7 @@ create_bg_pixmap (GdkColormap  *colormap,
   GdkVisual *visual = gdk_colormap_get_visual (colormap);
   GdkPixmap *pixmap = gdk_pixmap_new (gdk_screen_get_root_window (screen),
                                       1, 1,
-                                      visual->depth);
+                                      gdk_visual_get_depth (visual));
   cairo_t *cr;
 
   gdk_drawable_set_colormap (pixmap, colormap);
diff --git a/src/tray/na-tray-child.c b/src/tray/na-tray-child.c
index 30f2399..978880c 100644
--- a/src/tray/na-tray-child.c
+++ b/src/tray/na-tray-child.c
@@ -238,6 +238,7 @@ na_tray_child_new (GdkScreen *screen,
   gboolean visual_has_alpha;
   GdkColormap *colormap;
   gboolean new_colormap;
+  int red_prec, green_prec, blue_prec, depth;
   int result;
 
   g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
@@ -283,7 +284,11 @@ na_tray_child_new (GdkScreen *screen,
 
   /* We have alpha if the visual has something other than red, green,
    * and blue */
-  visual_has_alpha = visual->red_prec + visual->blue_prec + visual->green_prec < visual->depth;
+  gdk_visual_get_red_pixel_details (visual, NULL, NULL, &red_prec);
+  gdk_visual_get_green_pixel_details (visual, NULL, NULL, &green_prec);
+  gdk_visual_get_blue_pixel_details (visual, NULL, NULL, &blue_prec);
+  depth = gdk_visual_get_depth (visual);
+  visual_has_alpha = red_prec + blue_prec + green_prec < depth;
   child->has_alpha = (visual_has_alpha &&
 		      gdk_display_supports_composite (gdk_screen_get_display (screen)));
 



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