From 004d499ce38508c4ef6f7a564013a5636d6a7ea2 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 4 Nov 2016 12:06:52 +0100 Subject: [PATCH] fix: Make sure background colors are filled Fixes a bug where alignment changes caused the previous background to bleed over because of the shift. Fixes #141 --- src/components/bar.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/bar.cpp b/src/components/bar.cpp index c601f32b..d5ab892f 100644 --- a/src/components/bar.cpp +++ b/src/components/bar.cpp @@ -842,14 +842,17 @@ void bar::on_action_block_close(mousebtn btn) { // {{{ * Handle color change */ void bar::on_color_change(gc gc_, color color_) { // {{{ - m_log.trace_x("bar: color_change(%i, %s -> %s)", static_cast(gc_), color_.source(), color_); - - if (gc_ == gc::FG) { - m_fontmanager->allocate_color(color_); - } + m_log.trace_x("bar: color_change(%i, %s -> #%07x)", static_cast(gc_), color_.source(), + static_cast(color_)); const uint32_t value_list[]{color_}; m_connection.change_gc(m_gcontexts.at(gc_), XCB_GC_FOREGROUND, value_list); + + if (gc_ == gc::FG) { + m_fontmanager->allocate_color(color_); + } else if (gc_ == gc::BG) { + draw_shift(m_xpos, 0); + } } // }}} /**