[Not subscribed to mailing list.]
Hi. Been using blackbox in a secondary fashion for some time now.
Found some problems with 0.60.3-beta that seemed like they ought to be
reported and possibly fixed. In so doing, managed to add features as
well. :) Here we go:
(1) Some of the nls Makefile.{am,in}'s create absolute symlinks
instead of relative ones. Patch attached (against 0.60.1, but
applies with a little fuzz to 0.60.3) as
'blackbox-0.60.1-make.patch'.
(2) The toolbar clock can occasionally overflow the boundaries of the
space allotted to it, especially if the following are all true:
(a) you're using a proportional-width font;
(b) your date format includes the month and the weekday;
(c) your locale is C, POSIX, or en_US;
(d) it's a Wednesday in May.
The reason for this is that the width of the clock label is
determined by using the zero-width of the clock font. When using
a proportional font, however, characters such as 'M' and 'W' are
significantly wider than '0', and multiple occurrences of them
can cause the actual text to be wider than the allotted space.
Patch attached (against 0.60.2, but applies with no fuzz to
0.60.3) as 'blackbox-0.60.2-clock-width.patch'.
(3) The left- and right-pointing triangle pictures in the toolbar
buttons are barely recognizable as such due to pixel "jaggies".
Decreasing the altitudes and widening the bases of the triangles
makes them much less jaggy and much more aesthetically pleasing.
In addition, i was disappointed that the circles as menu bullets
went away between 0.51.3.1 and 0.60.1. Since i was having fun
with triangles anyway, it was a short step to make triangular
menu bullets, selectable with 'menu.bullet: triangle' in a style
file. Patch attached (against 0.60.2, small fuzz in 0.60.3) as
'blackbox-0.60.2-triangles.patch'.
(4) With the flat/solid optimizations in 0.60.3, the geometry window
gets crufted up under the following conditions:
(1) window.label.focus is "flat solid"
or
window.title.focus is "flat solid" and
window.label.focus is "parentrelative"
(2) you have just started or just restarted blackbox
Under these conditions, the geometry window gets a background
pixmap of 'None', which means 'inherit the background from the
parent window' (which appears empirically to be the root window).
Hence, the geometry window is transparent and the background is
not cleared when it is redrawn as a window is moved or resized.
Patch attached (against 0.60.3) as
'blackbox-0.60.3-flat-geometry-window.patch'.
(5) I find the internal "borders" (set by a combination of
window.frame.* and bevelWidth) to take up unnecessary desktop
space:
2 * bevelWidth * (clientHeight + clientWidth + 2 * bevelWidth)
The new '--disable-styled-frames' option to 'configure' isn't
enough for me; i find it better if i can disable that internal
(frame) border entirely. The attached patch adds an
'--enable-internal-borders' argument to 'configure' (defaults to
'yes') so that blackbox won't use internal borders at all. It's
a bit of a hack, since blackbox still checks for a frame border
on each window. My initial goal was to change as little as
possible (it can be optimized later). Patch attached (against
0.60.3) as 'blackbox-0.60.3-internal-border.patch'.
Wow. That's a lot. Maybe i should subscribe....
Cheers.
--
jim knoble | [EMAIL PROTECTED] | http://www.jmknoble.cx/
--- ./nls/es_ES/Makefile.am.orig-make Wed May 17 19:23:43 2000
+++ ./nls/es_ES/Makefile.am Sun May 21 20:47:51 2000
@@ -13,7 +13,7 @@
echo "Installing catalog in $(pkgdatadir)/nls/es_ES"; \
$(mkinstalldirs) $(pkgdatadir)/nls/es_ES ; \
$(INSTALL_DATA) blackbox.cat $(pkgdatadir)/nls/es_ES; \
- ln -sf $(pkgdatadir)/nls/es_ES $(pkgdatadir)/nls/es; \
+ ln -sf es_ES $(pkgdatadir)/nls/es; \
fi
# note... when adding new catalogs... you do not need the -h ../blackbox-nls.h
--- ./nls/es_ES/Makefile.in.orig-make Wed May 17 19:23:44 2000
+++ ./nls/es_ES/Makefile.in Sun May 21 20:47:39 2000
@@ -187,7 +187,7 @@
echo "Installing catalog in $(pkgdatadir)/nls/es_ES"; \
$(mkinstalldirs) $(pkgdatadir)/nls/es_ES ; \
$(INSTALL_DATA) blackbox.cat $(pkgdatadir)/nls/es_ES; \
- ln -sf $(pkgdatadir)/nls/es_ES $(pkgdatadir)/nls/es; \
+ ln -sf es_ES $(pkgdatadir)/nls/es; \
fi
# note... when adding new catalogs... you do not need the -h ../blackbox-nls.h
--- ./nls/Makefile.am.orig-make Wed May 17 19:26:54 2000
+++ ./nls/Makefile.am Sun May 21 20:39:56 2000
@@ -10,9 +10,9 @@
install-data-hook:
@if test x$(NLSTEST) = "x-DNLS"; then \
- ln -fs $(pkgdatadir)/nls/C $(pkgdatadir)/nls/US_ASCII; \
- ln -fs $(pkgdatadir)/nls/C $(pkgdatadir)/nls/POSIX; \
- ln -fs $(pkgdatadir)/nls/C $(pkgdatadir)/nls/en_US; \
- ln -fs $(pkgdatadir)/nls/C $(pkgdatadir)/nls/en; \
+ ln -fs C $(pkgdatadir)/nls/US_ASCII; \
+ ln -fs C $(pkgdatadir)/nls/POSIX; \
+ ln -fs C $(pkgdatadir)/nls/en_US; \
+ ln -fs C $(pkgdatadir)/nls/en; \
fi
--- ./nls/Makefile.in.orig-make Wed May 17 19:26:56 2000
+++ ./nls/Makefile.in Sun May 21 20:39:56 2000
@@ -292,10 +292,10 @@
install-data-hook:
@if test x$(NLSTEST) = "x-DNLS"; then \
- ln -fs $(pkgdatadir)/nls/C $(pkgdatadir)/nls/US_ASCII; \
- ln -fs $(pkgdatadir)/nls/C $(pkgdatadir)/nls/POSIX; \
- ln -fs $(pkgdatadir)/nls/C $(pkgdatadir)/nls/en_US; \
- ln -fs $(pkgdatadir)/nls/C $(pkgdatadir)/nls/en; \
+ ln -fs C $(pkgdatadir)/nls/US_ASCII; \
+ ln -fs C $(pkgdatadir)/nls/POSIX; \
+ ln -fs C $(pkgdatadir)/nls/en_US; \
+ ln -fs C $(pkgdatadir)/nls/en; \
fi
# Tell versions [3.59,3.63) of GNU make to not export all variables.
--- ./src/Toolbar.cc.orig-clkwidth Sun May 21 23:23:16 2000
+++ ./src/Toolbar.cc Mon May 22 06:05:36 2000
@@ -228,7 +228,7 @@
tt = localtime(&ttmp);
if (tt) {
char t[1024], *time_string = (char *) 0;
- int len = strftime(t, 1024, screen->getStrftimeFormat(), tt);
+ int len = 1 + strftime(t, 1024, screen->getStrftimeFormat(), tt);
time_string = new char[len + 1];
--- ./src/Toolbar.cc.orig-triangles Mon May 22 20:34:00 2000
+++ ./src/Toolbar.cc Mon May 22 20:39:12 2000
@@ -675,8 +675,8 @@
XPoint pts[3];
pts[0].x = hw - 2; pts[0].y = hh;
- pts[1].x = 4; pts[1].y = 2;
- pts[2].x = 0; pts[2].y = -4;
+ pts[1].x = 3; pts[1].y = 3;
+ pts[2].x = 0; pts[2].y = -6;
XFillPolygon(display, frame.psbutton, screen->getToolbarStyle()->b_pic_gc,
pts, 3, Convex, CoordModePrevious);
@@ -693,9 +693,9 @@
int hh = frame.button_w / 2, hw = frame.button_w / 2;
XPoint pts[3];
- pts[0].x = hw - 2; pts[0].y = hh - 2;
- pts[1].x = 4; pts[1].y = 2;
- pts[2].x = -4; pts[2].y = 2;
+ pts[0].x = hw - 1; pts[0].y = hh - 3;
+ pts[1].x = 3; pts[1].y = 3;
+ pts[2].x = -3; pts[2].y = 3;
XFillPolygon(display, frame.nsbutton, screen->getToolbarStyle()->b_pic_gc,
pts, 3, Convex, CoordModePrevious);
@@ -713,8 +713,8 @@
XPoint pts[3];
pts[0].x = hw - 2; pts[0].y = hh;
- pts[1].x = 4; pts[1].y = 2;
- pts[2].x = 0; pts[2].y = -4;
+ pts[1].x = 3; pts[1].y = 3;
+ pts[2].x = 0; pts[2].y = -6;
XFillPolygon(display, frame.pwbutton, screen->getToolbarStyle()->b_pic_gc,
pts, 3, Convex, CoordModePrevious);
@@ -731,9 +731,9 @@
int hh = frame.button_w / 2, hw = frame.button_w / 2;
XPoint pts[3];
- pts[0].x = hw - 2; pts[0].y = hh - 2;
- pts[1].x = 4; pts[1].y = 2;
- pts[2].x = -4; pts[2].y = 2;
+ pts[0].x = hw - 1; pts[0].y = hh - 3;
+ pts[1].x = 3; pts[1].y = 3;
+ pts[2].x = -3; pts[2].y = 3;
XFillPolygon(display, frame.nwbutton, screen->getToolbarStyle()->b_pic_gc,
pts, 3, Convex, CoordModePrevious);
--- ./src/Basemenu.cc.orig-triangles Sun May 21 22:36:27 2000
+++ ./src/Basemenu.cc Mon May 22 20:52:12 2000
@@ -686,21 +686,25 @@
case Triangle:
XPoint tri[3];
+#if 0
if (screen->getMenuStyle()->bullet_pos == Right) {
- tri[0].x = sel_x + quarter_w - 2;
- tri[0].y = sel_y + quarter_w - 2;
- tri[1].x = 4;
- tri[1].y = 2;
- tri[2].x = -4;
- tri[2].y = 2;
+#endif
+ tri[0].x = sel_x + quarter_w - 1;
+ tri[0].y = sel_y + quarter_w - 3;
+ tri[1].x = 3;
+ tri[1].y = 3;
+ tri[2].x = -3;
+ tri[2].y = 3;
+#if 0
} else {
tri[0].x = sel_x + quarter_w - 2;
tri[0].y = item_y + half_w;
- tri[1].x = 4;
- tri[1].y = 2;
+ tri[1].x = 3;
+ tri[1].y = 3;
tri[2].x = 0;
- tri[2].y = -4;
+ tri[2].y = -6;
}
+#endif
XFillPolygon(display, menu.frame, gc, tri, 3, Convex,
CoordModePrevious);
--- ./src/Screen.cc.orig-flatgeom Tue May 23 04:42:36 2000
+++ ./src/Screen.cc Tue Jul 18 05:31:47 2000
@@ -359,23 +359,32 @@
geom_w += (resource.bevel_width * 2);
geom_h += (resource.bevel_width * 2);
+ unsigned long geom_pixel = 0;
if (resource.wstyle.l_focus.getTexture() & BImage_ParentRelative) {
- if (resource.wstyle.t_focus.getTexture() == (BImage_Flat | BImage_Solid))
+ if (resource.wstyle.t_focus.getTexture() == (BImage_Flat | BImage_Solid)) {
geom_pixmap = None;
- else
+ geom_pixel = resource.wstyle.t_focus.getColor()->getPixel();
+ } else
geom_pixmap =
image_control->renderImage(geom_w, geom_h, &resource.wstyle.t_focus);
} else {
- if (resource.wstyle.l_focus.getTexture() == (BImage_Flat | BImage_Solid))
+ if (resource.wstyle.l_focus.getTexture() == (BImage_Flat | BImage_Solid)) {
geom_pixmap = None;
- else
+ geom_pixel = resource.wstyle.l_focus.getColor()->getPixel();
+ } else
geom_pixmap =
image_control->renderImage(geom_w, geom_h, &resource.wstyle.l_focus);
}
XSetWindowAttributes attrib;
- unsigned long mask = CWBackPixmap | CWBorderPixel | CWSaveUnder;
- attrib.background_pixmap = geom_pixmap;
+ unsigned long mask = CWBorderPixel | CWSaveUnder;
+ if (None == geom_pixmap) {
+ mask |= CWBackPixel;
+ attrib.background_pixel = geom_pixel;
+ } else {
+ mask |= CWBackPixmap;
+ attrib.background_pixmap = geom_pixmap;
+ }
attrib.border_pixel = getBorderColor()->getPixel();
attrib.save_under = True;
--- ./src/Makefile.am.orig-intborder Thu May 25 13:51:45 2000
+++ ./src/Makefile.am Tue Jul 18 04:44:49 2000
@@ -24,6 +24,7 @@
CPPFLAGS= @CPPFLAGS@ @SHAPE@ @SLIT@ @INTERLACE@ @ORDEREDPSEUDO@ \
@STYLEDFRAMES@ @DEBUG@ @NEWWMSPEC@ @NLS@ @TIMEDCACHE@ \
+@ENABLE_INTERNAL_BORDER@ \
-DLOCALEPATH=\"$(pkgdatadir)/nls\" \
-DDEFAULTMENU=\"$(DEFAULT_MENU)\" \
-DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\"
--- ./src/Window.cc.orig-intborder Thu May 25 23:17:12 2000
+++ ./src/Window.cc Tue Jul 18 04:47:26 2000
@@ -55,6 +55,10 @@
# endif // HAVE_STDIO_H
#endif // DEBUG
+#ifndef ENABLE_INTERNAL_BORDER
+# define ENABLE_INTERNAL_BORDER True
+#endif // ENABLE_INTERNAL_BORDER
+
BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) {
#ifdef DEBUG
fprintf(stderr,
@@ -92,7 +96,8 @@
frame.pbutton = frame.uborder = frame.fborder = frame.ugrip = None;
frame.fgrip = None;
- decorations.titlebar = decorations.border = decorations.handle = True;
+ decorations.border = ENABLE_INTERNAL_BORDER;
+ decorations.titlebar = decorations.handle = True;
decorations.iconify = decorations.maximize = decorations.menu = True;
functions.resize = functions.move = functions.iconify = functions.maximize = True;
functions.close = decorations.close = False;
@@ -1159,17 +1164,18 @@
client.mwm_hint)
if (num == PropMwmHintsElements) {
if (client.mwm_hint->flags & MwmHintsDecorations)
- if (client.mwm_hint->decorations & MwmDecorAll)
- decorations.titlebar = decorations.handle = decorations.border =
+ if (client.mwm_hint->decorations & MwmDecorAll) {
+ decorations.border = ENABLE_INTERNAL_BORDER;
+ decorations.titlebar = decorations.handle =
decorations.iconify = decorations.maximize =
decorations.close = decorations.menu = True;
- else {
+ } else {
decorations.titlebar = decorations.handle = decorations.border =
decorations.iconify = decorations.maximize =
decorations.close = decorations.menu = False;
if (client.mwm_hint->decorations & MwmDecorBorder)
- decorations.border = True;
+ decorations.border = ENABLE_INTERNAL_BORDER;
if (client.mwm_hint->decorations & MwmDecorHandle)
decorations.handle = True;
if (client.mwm_hint->decorations & MwmDecorTitle)
@@ -1253,7 +1259,8 @@
default:
case DecorNormal:
- decorations.titlebar = decorations.border = decorations.handle =
+ decorations.border = ENABLE_INTERNAL_BORDER;
+ decorations.titlebar = decorations.handle =
decorations.iconify = decorations.maximize =
decorations.menu = True;
functions.resize = functions.move = functions.iconify =
@@ -2921,7 +2928,8 @@
default:
case DecorNormal:
- decorations.titlebar = decorations.border = decorations.handle =
+ decorations.border = ENABLE_INTERNAL_BORDER;
+ decorations.titlebar = decorations.handle =
decorations.iconify = decorations.maximize =
decorations.menu = True;
functions.resize = functions.move = functions.iconify =
--- ./configure.in.orig-intborder Thu May 25 13:49:06 2000
+++ ./configure.in Tue Jul 18 04:44:49 2000
@@ -166,6 +166,24 @@
)
AC_SUBST(STYLEDFRAMES)
+dnl Check whether to include support for internal window frame borders
+ENABLE_INTERNAL_BORDER=""
+AC_MSG_CHECKING([whether to decorate windows with internal borders])
+AC_ARG_ENABLE(internal-borders,
+[ --enable-internal-borders decorate windows with internal borders
+ [default=yes]],
+ if test x$enableval = "xyes"; then
+ AC_MSG_RESULT([yes])
+ ENABLE_INTERNAL_BORDER="-DENABLE_INTERNAL_BORDER=True"
+ else
+ AC_MSG_RESULT([no])
+ ENABLE_INTERNAL_BORDER="-DENABLE_INTERNAL_BORDER=False"
+ fi,
+ AC_MSG_RESULT([yes])
+ ENABLE_INTERNAL_BORDER="-DENABLE_INTERNAL_BORDER=True"
+)
+AC_SUBST(ENABLE_INTERNAL_BORDER)
+
dnl Check whether to include debugging code
DEBUG=""
AC_MSG_CHECKING([whether to include verbose debugging code])