1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-25 13:55:47 -05:00

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
This commit is contained in:
Michael Carlberg 2016-11-04 12:06:52 +01:00
parent 2a59236441
commit 004d499ce3

View file

@ -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<int>(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<int>(gc_), color_.source(),
static_cast<uint32_t>(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);
}
} // }}}
/**