trayicon-x11: Fix warnings when visual is not available.

This fixes a regression introduced in commit
b1a1685a33eca16979e63d79915395af0b36. gdk_visual_get_*_pixel_details()
should not be called with a NULL visual.

https://bugzilla.gnome.org/show_bug.cgi?id=649588
This commit is contained in:
Vincent Bernat 2011-08-27 20:06:26 +02:00 committed by Benjamin Otte
parent 64b85e7bd8
commit 6754614ac1

View File

@ -505,9 +505,12 @@ 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);
if (visual != NULL)
{
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 &&