From cd005a9ce6ff109420d17f7a5abe4acf153d86e4 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 22 Nov 2016 22:44:27 +0100 Subject: [PATCH] fix(renderer): Avoid false positives Ref #181 --- src/components/renderer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/renderer.cpp b/src/components/renderer.cpp index 4b8ded11..7f39c1d7 100644 --- a/src/components/renderer.cpp +++ b/src/components/renderer.cpp @@ -181,15 +181,16 @@ void renderer::reserve_space(edge side, uint16_t w) { } void renderer::set_background(const gc gcontext, const uint32_t color) { - if (color == m_background) + if (color == m_background && gcontext == m_background_gc) return; m_log.trace_x("renderer: set_background(%i, #%08x)", static_cast(gcontext), color); m_connection.change_gc(m_gcontexts.at(gcontext), XCB_GC_BACKGROUND, &color); m_background = color; + m_background_gc = gcontext; } void renderer::set_foreground(const gc gcontext, const uint32_t color) { - if (color == m_foreground) + if (color == m_foreground && gcontext == m_foreground_gc) return; m_log.trace_x("renderer: set_foreground(%i, #%08x)", static_cast(gcontext), color); m_connection.change_gc(m_gcontexts.at(gcontext), XCB_GC_FOREGROUND, &color); @@ -198,6 +199,7 @@ void renderer::set_foreground(const gc gcontext, const uint32_t color) { else if (gcontext == gc::BG) shift_content(0); m_foreground = color; + m_foreground_gc = gcontext; } void renderer::set_fontindex(const uint8_t font) {