From 204ab89921c951b891180e6870f20c3918028586 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 26 Oct 2016 01:50:36 +0200 Subject: [PATCH] fix(bar): Use premultiplied rgb color for X fonts Closes jaagr/lemonbuddy#119 --- include/components/bar.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/components/bar.hpp b/include/components/bar.hpp index 9e78b8ba..6463614c 100644 --- a/include/components/bar.hpp +++ b/include/components/bar.hpp @@ -784,8 +784,10 @@ class bar : public xpp::event::sinkallocate_color(color_); + m_xfont_color = color::parse(color_.rgb()).value(); + } } //}}} /** @@ -946,6 +948,13 @@ class bar : public xpp::event::sinkset_gcontext_font(m_gcontexts.at(gc::FG), m_gcfont); } + if (font->ptr && m_xfont_color != 0) { + m_log.trace_x("bar: Set gcontext color for xcb font"); + const uint32_t values[1]{m_xfont_color}; + m_connection.change_gc(m_gcontexts.at(gc::FG), XCB_GC_FOREGROUND, values); + m_xfont_color = 0; + } + // TODO: cache auto chr_width = m_fontmanager->char_width(font, character); @@ -1000,6 +1009,7 @@ class bar : public xpp::event::sink