1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-09 21:52:10 -05:00

GTK: correct a misuse of WhitePixel and BlackPixel

According to the X specs, WhitePixel and BlackPixel refer to permanent
entries in the default colourmap.  This means that they're not
necessarily appropriate for use with a Drawable with a different depth
than the root window.  When drawing to a Pixmap that will be used as a
1-bit alpha mask by Cairo, the correct values are simply 0
(transparent) and 1 (opaque).
This commit is contained in:
Ben Harris 2025-04-24 22:13:07 +01:00
parent c71cc50e52
commit 578ed46f34

View File

@ -677,8 +677,8 @@ static void x11font_cairo_setup(
xfi->pixmap_surface = cairo_xlib_surface_create_for_bitmap(
disp, xfi->pixmap, ScreenOfDisplay(disp, widgetscr),
xfi->pixwidth, xfi->pixheight);
gcvals.foreground = WhitePixel(disp, widgetscr);
gcvals.background = BlackPixel(disp, widgetscr);
gcvals.foreground = 1;
gcvals.background = 0;
gcvals.font = xfi->xfs->fid;
xfi->gc = XCreateGC(disp, xfi->pixmap,
GCForeground | GCBackground | GCFont, &gcvals);