Hello jeff covey on Sun, May 21, 2006 at 04:21:52PM CEST, you wrote:
> thanks, that feels soooo much better! :) i hope this or another solution
> can work its way into the official source.
Glad you like it. Anselm thought of providing additional patches for
various add-on functionality in the near future. This way various
patches would not clutter the code while still making it easy to
customize wmii at compile time.
Earlier today I stated:
> > However I have to agree that the patch does not work well with floating
> > clients at the moment (they are placed above the bar)
Please find attached another patch (this time in unified diff) which
remedies this problem and places new floating clients right below the
bar on the top of the screen, if they have not been configured
differently (e.g. via ~/.Xresources). I just couldn't live with the
shame of not having worked thoroughly ;)
Note that the patch needs to be applied to the original sources
contained in wmii-3.tar.gz (in other words: please reverse previously
applied bar-on-top patches).
Greetings Alexis.
diff -Nur wmii-3.orig/cmd/Makefile wmii-3/cmd/Makefile
--- wmii-3.orig/cmd/Makefile 2006-05-19 13:20:53.000000000 +0200
+++ wmii-3/cmd/Makefile 2006-05-21 12:51:37.000000000 +0200
@@ -22,4 +22,4 @@
# @${CC} -o $* $*.o ${LDFLAGS} -lsocket
clean:
- rm -f wmiimenu wmiir wmiipsel wmiiwarp *.o
+ rm -f wmiisetsid wmiimenu wmiir wmiipsel wmiiwarp *.o
diff -Nur wmii-3.orig/cmd/wm/area.c wmii-3/cmd/wm/area.c
--- wmii-3.orig/cmd/wm/area.c 2006-05-19 13:20:53.000000000 +0200
+++ wmii-3/cmd/wm/area.c 2006-05-21 18:07:49.000000000 +0200
@@ -41,6 +41,7 @@
a->view = v;
a->id = id++;
a->rect = rect;
+ a->rect.y = AREA_VIEW_Y;
a->rect.height = rect.height - brect.height;
a->mode = def.colmode;
a->rect.width = w;
@@ -185,8 +186,8 @@
x = 0;
else
x = fr->rect.x / dx;
- if(fr->rect.y < 0)
- y = 0;
+ if(fr->rect.y < AREA_VIEW_Y)
+ y = AREA_VIEW_Y;
else
y = fr->rect.y / dy;
maxx = (fr->rect.x + fr->rect.width) / dx;
@@ -226,7 +227,7 @@
}
if(fit && (p1.y + f->rect.height < a->rect.y + a->rect.height))
- f->rect.y = p1.y;
+ f->rect.y = (p1.y < AREA_VIEW_Y) ? AREA_VIEW_Y : p1.y;
else {
diff = a->rect.height - f->rect.height;
f->rect.y = a->rect.y + (random() % (diff ? diff : 1));
diff -Nur wmii-3.orig/cmd/wm/bar.c wmii-3/cmd/wm/bar.c
--- wmii-3.orig/cmd/wm/bar.c 2006-05-19 13:20:53.000000000 +0200
+++ wmii-3/cmd/wm/bar.c 2006-05-19 18:42:27.000000000 +0200
@@ -74,7 +74,7 @@
unsigned int i, j;
brect = rect;
brect.height = height_of_bar();
- brect.y = rect.height - brect.height;
+ brect.y = WM_BAR_Y;
XMoveResizeWindow(dpy, barwin, brect.x, brect.y, brect.width,
brect.height);
XSync(dpy, False);
XFreePixmap(dpy, barpmap);
diff -Nur wmii-3.orig/cmd/wm/view.c wmii-3/cmd/wm/view.c
--- wmii-3.orig/cmd/wm/view.c 2006-05-19 13:20:53.000000000 +0200
+++ wmii-3/cmd/wm/view.c 2006-05-19 18:42:27.000000000 +0200
@@ -318,7 +318,7 @@
for(i = 1; i < v->area.size; i++) {
Area *a = v->area.data[i];
a->rect.x = xoff;
- a->rect.y = 0;
+ a->rect.y = AREA_VIEW_Y;
a->rect.height = rect.height - brect.height;
xoff += a->rect.width;
arrange_column(a, False);
diff -Nur wmii-3.orig/cmd/wm/wm.c wmii-3/cmd/wm/wm.c
--- wmii-3.orig/cmd/wm/wm.c 2006-05-19 13:20:53.000000000 +0200
+++ wmii-3/cmd/wm/wm.c 2006-05-19 18:42:27.000000000 +0200
@@ -327,7 +327,7 @@
brect = rect;
brect.height = height_of_bar();
- brect.y = rect.height - brect.height;
+ brect.y = WM_BAR_Y;
barwin = XCreateWindow(dpy, RootWindow(dpy, screen), brect.x, brect.y,
brect.width, brect.height, 0, DefaultDepth(dpy, screen),
CopyFromParent, DefaultVisual(dpy, screen),
diff -Nur wmii-3.orig/cmd/wm/wm.h wmii-3/cmd/wm/wm.h
--- wmii-3.orig/cmd/wm/wm.h 2006-05-19 13:20:53.000000000 +0200
+++ wmii-3/cmd/wm/wm.h 2006-05-19 18:42:27.000000000 +0200
@@ -10,6 +10,14 @@
#include <ixp.h>
#include <blitz.h>
+#if BAR_ON_TOP == 1
+#define WM_BAR_Y 0
+#define AREA_VIEW_Y brect.height
+#else
+#define WM_BAR_Y rect.height - brect.height
+#define AREA_VIEW_Y 0
+#endif
+
/* WM atoms */
enum {
WMState,
diff -Nur wmii-3.orig/cmd/wmiimenu.c wmii-3/cmd/wmiimenu.c
--- wmii-3.orig/cmd/wmiimenu.c 2006-05-19 13:20:53.000000000 +0200
+++ wmii-3/cmd/wmiimenu.c 2006-05-19 18:42:27.000000000 +0200
@@ -20,6 +20,12 @@
#include <blitz.h>
#include <cext.h>
+#if BAR_ON_TOP == 1
+#define MENU_Y 0
+#else
+#define MENU_Y DisplayHeight(dpy, screen) - mrect.height
+#endif
+
VECTOR(ItemVector, char *);
static Bool done = False;
static int ret = 0;
@@ -373,7 +379,7 @@
mrect.width = DisplayWidth(dpy, screen);
mrect.height = draw.font.ascent + draw.font.descent + 4;
- mrect.y = DisplayHeight(dpy, screen) - mrect.height;
+ mrect.y = MENU_Y;
mrect.x = 0;
win = XCreateWindow(dpy, RootWindow(dpy, screen), mrect.x, mrect.y,
diff -Nur wmii-3.orig/config.mk wmii-3/config.mk
--- wmii-3.orig/config.mk 2006-05-19 13:20:53.000000000 +0200
+++ wmii-3/config.mk 2006-05-21 12:50:56.000000000 +0200
@@ -12,10 +12,11 @@
# includes and libs
LIBS = -L${PREFIX}/lib -L/usr/lib -lc -L${X11LIB} -lX11
+BAR_ON_TOP = 0
# Linux/BSD
CFLAGS = -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
- -DVERSION=\"${VERSION}\"
+ -DVERSION=\"${VERSION}\" -DBAR_ON_TOP=${BAR_ON_TOP}
LDFLAGS = ${LIBS}
# Solaris
_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii