From 68e9677bbb9ebe8f7c1a5edea25f236c09ed3460 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 19 May 2003 09:40:14 +0000 Subject: fixed minor bug in solid rendering, makes sure we get valid color string before we set background --- util/bsetroot.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/util/bsetroot.cc b/util/bsetroot.cc index 2b87282..4e03e0b 100644 --- a/util/bsetroot.cc +++ b/util/bsetroot.cc @@ -18,7 +18,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// $Id: bsetroot.cc,v 1.17 2003/05/11 00:00:32 fluxgen Exp $ +// $Id: bsetroot.cc,v 1.18 2003/05/19 09:40:14 fluxgen Exp $ #include "bsetroot.hh" @@ -208,14 +208,15 @@ void bsetroot::solid() { pixmaps = new Pixmap[ScreenCount(display())]; for (; screen < ScreenCount(display()); screen++) { + FbTk::Color c; + if (!c.setFromString(fore, screen)) // just report error + continue; + FbRootWindow root(screen); - FbTk::Color c; GC gc; XGCValues gcv; - c.setFromString(fore, screen); - if (! c.isAllocated()) c.setPixel(BlackPixel(display(), screen)); @@ -242,10 +243,10 @@ void bsetroot::solid() { } } -//-------------- modula ------------------ -// draws pixmaps with an 16x16 pattern with -// fg and bg colors. -//----------------------------------------- +/** + Draws pixmaps with an 16x16 pattern with + fg and bg colors. +*/ void bsetroot::modula(int x, int y) { char data[32]; long pattern; @@ -331,7 +332,7 @@ void bsetroot::modula(int x, int y) { /** draws pixmaps with a fluxbox texure */ -void bsetroot::gradient(void) { +void bsetroot::gradient() { // using temporaray pixmap and then copying it to background pixmap, as it'll // get crashed somewhere on the way causing apps like XChat chrashing // as the pixmap has been destroyed -- cgit v0.11.2