diff options
author | Benjamin Otte <otte@redhat.com> | 2011-08-28 20:19:55 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-08-28 20:20:35 +0200 |
commit | dca3ea896e39bc918bcf7330816ded6bc1682cb8 (patch) | |
tree | a89ca83c59ded8c046f89d3ac445c66b225e7b91 | |
parent | 6754614ac1ce8f72c0d0ec2369408ac61e080dab (diff) | |
download | gtk+-dca3ea896e39bc918bcf7330816ded6bc1682cb8.tar.gz |
trayicon-x11: Refactor code a bit
Should make it more obvious what the code actually does.
-rw-r--r-- | gtk/gtktrayicon-x11.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c index f31b58e2db..d4f0706c68 100644 --- a/gtk/gtktrayicon-x11.c +++ b/gtk/gtktrayicon-x11.c @@ -479,9 +479,6 @@ 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); @@ -507,14 +504,18 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon) if (visual != NULL) { + gint red_prec, green_prec, blue_prec; + 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_rgba = + (red_prec + blue_prec + green_prec < gdk_visual_get_depth (visual)); } + else + icon->priv->manager_visual_rgba = FALSE; icon->priv->manager_visual = visual; - icon->priv->manager_visual_rgba = visual != NULL && - (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 */ |