From 57a6a26be7e9906ddc5612f017a0e84557cba462 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 15 Jan 2010 13:19:08 +0200 Subject: [PATCH] Ticket #1657: Transparency support is broken in 4.7.0-pre3 The latest version breaks transparency support. If I'd change _default_ to lightgray;default in the [core] section, the panels are unreadable. It looks like the _default_ variable interpreted as lightgray;lightgray. Fix Issue: do not apply COLOR_WHITE as mask if color value equal to -1 Signed-off-by: Slava Zanko --- src/tty/color-ncurses.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tty/color-ncurses.c b/src/tty/color-ncurses.c index 9badb5ebe..f31750ef2 100644 --- a/src/tty/color-ncurses.c +++ b/src/tty/color-ncurses.c @@ -171,10 +171,13 @@ tty_color_try_alloc_pair_lib (tty_color_pair_t * mc_color_pair) break; } } else { + int mask_fg = (mc_color_pair->ifg == -1) ? mc_color_pair->ifg : 0xff; + int mask_bg = (mc_color_pair->ibg == -1) ? mc_color_pair->ibg : 0xff; + init_pair (mc_color_pair->pair_index, mc_tty_color_save_attr_lib (mc_color_pair->pair_index, - mc_color_pair->ifg) & COLOR_WHITE, - mc_color_pair->ibg & COLOR_WHITE); + mc_color_pair->ifg) & mask_fg, + mc_color_pair->ibg & mask_bg); } }