I traced back this problem to the following problem:
When creating the shape of the decoration window, icewm uses
YColor::white to draw into the mask. But if you only have 21 bits of
color depth, YColor::white->pixel is 0xfefefe. If this value is given
to a 1 bit depth GC as foreground, it is trucated to the relavant bits,
which is "0" in this case. Thus the mask of the decoration Window is
empty and thus the content will not show up in there.
I suggest the following fix:
add a new setColor to directly give a value:
diff -r -u icewm-1.2.23/src/ypaint.h icewm-patched/src/ypaint.h
--- icewm-1.2.23/src/ypaint.h 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/ypaint.h 2005-12-04 14:30:40.000000000 +0100
@@ -245,6 +245,7 @@
int const mode);
void fillArc(int x, int y, int width, int height, int a1, int a2);
void setColor(YColor * aColor);
+ void setColor(unsigned long pixel);
void setFont(ref<YFont> aFont);
void setThinLines(void) { setLineWidth(0); }
void setWideLines(int width = 1) { setLineWidth(width >= 1 ? width : 1); }
diff -r -u icewm-1.2.23/src/ypaint.cc icewm-patched/src/ypaint.cc
--- icewm-1.2.23/src/ypaint.cc 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/ypaint.cc 2005-12-04 14:29:56.000000000 +0100
@@ -591,6 +591,10 @@
XSetForeground(fDisplay, gc, fColor->pixel());
}
+void Graphics::setColor(unsigned long pixel) {
+ XSetForeground(fDisplay, gc, pixel);
+}
+
void Graphics::setFont(ref<YFont> aFont) {
fFont = aFont;
}
and then use that one to use the proper value for the shape-mask:
diff -r -u icewm-1.2.23/src/decorate.cc icewm-patched/src/decorate.cc
--- icewm-1.2.23/src/decorate.cc 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/decorate.cc 2005-12-04 14:39:19.000000000 +0100
@@ -215,7 +215,7 @@
Pixmap shape(YPixmap::createMask(width(), height()));
Graphics g(shape, width(), height());
- g.setColor(YColor::white);
+ g.setColor(1);
g.fillRect(0, 0, width(), height());
const int xTL(frameTL[t][a] != null ? frameTL[t][a]->width() : 0),
With this fix, icewm is working properly on my UltraSparc, which I used
for testing.
Doing a fast grep over the source for other usages of YColor::white, at
least the following seem to need a fix, too:
diff -r -u icewm-1.2.23/src/yimage.cc icewm-patched/src/yimage.cc
--- icewm-1.2.23/src/yimage.cc 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/yimage.cc 2005-12-04 14:44:02.000000000 +0100
@@ -172,10 +172,10 @@
fMask = createMask(nw, nh);
Graphics g(fMask, nw, nh);
- g.setColor(YColor::white);
+ g.setColor(1);
g.fillRect(0, 0, nw, nh);
- g.setColor(YColor::black);
+ g.setColor(0);
//
// nested rendering loop inspired by gdk-pixbuf
//
diff -r -u icewm-1.2.23/src/wmframe.cc icewm-patched/src/wmframe.cc
--- icewm-1.2.23/src/wmframe.cc 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/wmframe.cc 2005-12-04 14:42:07.000000000 +0100
@@ -2254,9 +2254,9 @@
ref<YPixmap> img(new YPixmap(w, h));
Graphics g(img, 0, 0);
- g.setColor(YColor::white);
+ g.setColor(1);
g.fillRect(0, 0, w, h);
- g.setColor(YColor::black);
+ g.setColor(0);
g.setClipMask(pixmap);
g.fillRect(0, 0, w, h);
Hochachtungsvoll,
Bernhard R. Link
Only in icewm-1.2.23/src/: config.h
diff -r -u icewm-1.2.23/src/decorate.cc icewm-patched/src/decorate.cc
--- icewm-1.2.23/src/decorate.cc 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/decorate.cc 2005-12-04 14:39:19.000000000 +0100
@@ -215,7 +215,7 @@
Pixmap shape(YPixmap::createMask(width(), height()));
Graphics g(shape, width(), height());
- g.setColor(YColor::white);
+ g.setColor(1);
g.fillRect(0, 0, width(), height());
const int xTL(frameTL[t][a] != null ? frameTL[t][a]->width() : 0),
Only in icewm-1.2.23/src/: Makefile
Only in icewm-1.2.23/src/: wmapp.cc
diff -r -u icewm-1.2.23/src/wmframe.cc icewm-patched/src/wmframe.cc
--- icewm-1.2.23/src/wmframe.cc 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/wmframe.cc 2005-12-04 14:42:07.000000000 +0100
@@ -2254,9 +2254,9 @@
ref<YPixmap> img(new YPixmap(w, h));
Graphics g(img, 0, 0);
- g.setColor(YColor::white);
+ g.setColor(1);
g.fillRect(0, 0, w, h);
- g.setColor(YColor::black);
+ g.setColor(0);
g.setClipMask(pixmap);
g.fillRect(0, 0, w, h);
diff -r -u icewm-1.2.23/src/yimage.cc icewm-patched/src/yimage.cc
--- icewm-1.2.23/src/yimage.cc 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/yimage.cc 2005-12-04 14:44:02.000000000 +0100
@@ -172,10 +172,10 @@
fMask = createMask(nw, nh);
Graphics g(fMask, nw, nh);
- g.setColor(YColor::white);
+ g.setColor(1);
g.fillRect(0, 0, nw, nh);
- g.setColor(YColor::black);
+ g.setColor(0);
//
// nested rendering loop inspired by gdk-pixbuf
//
diff -r -u icewm-1.2.23/src/ypaint.cc icewm-patched/src/ypaint.cc
--- icewm-1.2.23/src/ypaint.cc 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/ypaint.cc 2005-12-04 14:29:56.000000000 +0100
@@ -591,6 +591,10 @@
XSetForeground(fDisplay, gc, fColor->pixel());
}
+void Graphics::setColor(unsigned long pixel) {
+ XSetForeground(fDisplay, gc, pixel);
+}
+
void Graphics::setFont(ref<YFont> aFont) {
fFont = aFont;
}
diff -r -u icewm-1.2.23/src/ypaint.h icewm-patched/src/ypaint.h
--- icewm-1.2.23/src/ypaint.h 2005-08-14 20:33:08.000000000 +0200
+++ icewm-patched/src/ypaint.h 2005-12-04 14:30:40.000000000 +0100
@@ -245,6 +245,7 @@
int const mode);
void fillArc(int x, int y, int width, int height, int a1, int a2);
void setColor(YColor * aColor);
+ void setColor(unsigned long pixel);
void setFont(ref<YFont> aFont);
void setThinLines(void) { setLineWidth(0); }
void setWideLines(int width = 1) { setLineWidth(width >= 1 ? width : 1); }