diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-12-10 02:32:18 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-12-10 02:32:18 -0500 |
commit | 948ab1a1685a33eca16979e63d79915395af0b36 (patch) | |
tree | fcfae8afadbba3880fa00bf75a1204210e228bdf /gtk/gtktrayicon-x11.c | |
parent | 83204928b93bbdf412fab39456710288b7abe5e8 (diff) | |
download | gtk+-948ab1a1685a33eca16979e63d79915395af0b36.tar.gz |
Don't access GdkVisual fields directly
Use accessors instead.
Diffstat (limited to 'gtk/gtktrayicon-x11.c')
-rw-r--r-- | gtk/gtktrayicon-x11.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c index 150b634823..4689d3ca53 100644 --- a/gtk/gtktrayicon-x11.c +++ b/gtk/gtktrayicon-x11.c @@ -445,6 +445,9 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon) gulong bytes_after; int error, result; GdkVisual *visual; + gint red_prec; + gint green_prec; + gint blue_prec; g_assert (icon->priv->manager_window != None); @@ -468,9 +471,13 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon) visual = gdk_x11_screen_lookup_visual (screen, visual_id); } + 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); + icon->priv->manager_visual = visual; icon->priv->manager_visual_rgba = visual != NULL && - (visual->red_prec + visual->blue_prec + visual->green_prec < visual->depth); + (red_prec + blue_prec + green_prec < gdk_visual_get_depth (visual)); /* For the background-relative hack we use when we aren't using a real RGBA * visual, we can't be double-buffered */ @@ -844,7 +851,7 @@ gtk_tray_icon_set_visual (GtkTrayIcon *icon) * to be either the screen default visual or a TrueColor visual; ignore it * if it is something else */ - if (visual && visual->type != GDK_VISUAL_TRUE_COLOR) + if (visual && gdk_visual_get_visual_type (visual) != GDK_VISUAL_TRUE_COLOR) visual = NULL; if (visual == NULL) |