all repos — fluxbox @ 2fdc6ab808d3828cba1bacaff536d607dfa60c58

custom fork of the fluxbox windowmanager

dont free old color until we have a valid new color
fluxgen fluxgen
commit

2fdc6ab808d3828cba1bacaff536d607dfa60c58

parent

7906f1be1772c01d86e0ca647c82fd8cf270933d

1 files changed, 2 insertions(+), 3 deletions(-)

jump to
M src/FbTk/Color.ccsrc/FbTk/Color.cc

@@ -116,7 +116,7 @@

return XParseColor(disp, colm, color_string_tmp.c_str(), &color) != 0; } -Color &Color::operator = (const Color &col_copy) { +Color &Color::operator = (const Color &col_copy) { // check for aliasing if (this == &col_copy) return *this;

@@ -144,8 +144,6 @@ setRGB(col_copy.red(), col_copy.green(), col_copy.blue());

setPixel(col_copy.pixel()); return; } - - free(); allocate(col_copy.red()*0xFF, col_copy.green()*0xFF,

@@ -168,6 +166,7 @@ if (!XAllocColor(disp, DefaultColormap(disp, screen), &color)) {

_FB_USES_NLS; cerr<<"FbTk::Color: "<<_FBTKTEXT(Error, ColorAllocation, "Allocation error.", "XAllocColor failed...")<<endl; } else { + free(); setRGB(maxValue(color.red), maxValue(color.green), maxValue(color.blue));