1
0
forked from aniani/vim

patch 7.4.2089

Problem:    Color handling of X11 GUIs is too complicated.
Solution:   Simplify the code.  Use RGBA where appropriate. (Kazunobu
            Kuriyama)
This commit is contained in:
Bram Moolenaar
2016-07-21 22:10:12 +02:00
parent f36213597d
commit 36edf0685c
5 changed files with 125 additions and 197 deletions

View File

@@ -3097,24 +3097,9 @@ netbeans_draw_multisign_indicator(int row)
#if GTK_CHECK_VERSION(3,0,0)
cr = cairo_create(gui.surface);
{
GdkVisual *visual = NULL;
guint32 r_mask, g_mask, b_mask;
gint r_shift, g_shift, b_shift;
visual = gdk_window_get_visual(gtk_widget_get_window(gui.drawarea));
if (visual != NULL)
{
gdk_visual_get_red_pixel_details(visual, &r_mask, &r_shift, NULL);
gdk_visual_get_green_pixel_details(visual, &g_mask, &g_shift, NULL);
gdk_visual_get_blue_pixel_details(visual, &b_mask, &b_shift, NULL);
cairo_set_source_rgb(cr,
((gui.fgcolor->red & r_mask) >> r_shift) / 255.0,
((gui.fgcolor->green & g_mask) >> g_shift) / 255.0,
((gui.fgcolor->blue & b_mask) >> b_shift) / 255.0);
}
}
cairo_set_source_rgba(cr,
gui.fgcolor->red, gui.fgcolor->green, gui.fgcolor->blue,
gui.fgcolor->alpha);
#endif
x = 0;