Hello,
please find attached the bar on top patch for the latest
release candiate wmii-20060504-rc2-slavutych.
Anselm, I wondered whether it would be possible and acceptable
to integrate the patch for upcoming wmii versions.
Having the bar on top as a compile time option does not influence
the code at runtime, it does not clutter the affected code parts,
but it does increases the overall LOC in wm.h
and wmiimenu.c by a couple of lines.
Regards Alexis.
--
Tip 13: Eliminate Effects Between Unrelated Things
-- The Pragmatic Programmer
diff -Narc wmii-20060504-rc2-slavutych.ORIG/cmd/wm/area.c
wmii-20060504-rc2-slavutych/cmd/wm/area.c
*** wmii-20060504-rc2-slavutych.ORIG/cmd/wm/area.c 2006-05-04
15:02:14.000000000 +0200
--- wmii-20060504-rc2-slavutych/cmd/wm/area.c 2006-05-04 18:41:08.973288737
+0200
***************
*** 41,46 ****
--- 41,47 ----
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;
***************
*** 186,193 ****
x = 0;
else
x = fr->rect.x / dx;
! if(fr->rect.y < 0)
! y = 0;
else
y = fr->rect.y / dy;
maxx = (fr->rect.x + fr->rect.width) / dx;
--- 187,194 ----
x = 0;
else
x = fr->rect.x / dx;
! 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;
diff -Narc wmii-20060504-rc2-slavutych.ORIG/cmd/wm/bar.c
wmii-20060504-rc2-slavutych/cmd/wm/bar.c
*** wmii-20060504-rc2-slavutych.ORIG/cmd/wm/bar.c 2006-05-04
15:02:14.000000000 +0200
--- wmii-20060504-rc2-slavutych/cmd/wm/bar.c 2006-05-04 18:41:23.586653516
+0200
***************
*** 74,80 ****
unsigned int i, j;
brect = rect;
brect.height = height_of_bar();
! brect.y = rect.height - brect.height;
XMoveResizeWindow(dpy, barwin, brect.x, brect.y, brect.width,
brect.height);
XSync(dpy, False);
XFreePixmap(dpy, barpmap);
--- 74,80 ----
unsigned int i, j;
brect = rect;
brect.height = height_of_bar();
! brect.y = WM_BAR_Y;
XMoveResizeWindow(dpy, barwin, brect.x, brect.y, brect.width,
brect.height);
XSync(dpy, False);
XFreePixmap(dpy, barpmap);
diff -Narc wmii-20060504-rc2-slavutych.ORIG/cmd/wm/view.c
wmii-20060504-rc2-slavutych/cmd/wm/view.c
*** wmii-20060504-rc2-slavutych.ORIG/cmd/wm/view.c 2006-05-04
15:02:14.000000000 +0200
--- wmii-20060504-rc2-slavutych/cmd/wm/view.c 2006-05-04 18:41:38.416994132
+0200
***************
*** 318,324 ****
for(i = 1; i < v->area.size; i++) {
Area *a = v->area.data[i];
a->rect.x = xoff;
! a->rect.y = 0;
a->rect.height = rect.height - brect.height;
xoff += a->rect.width;
arrange_column(a, False);
--- 318,324 ----
for(i = 1; i < v->area.size; i++) {
Area *a = v->area.data[i];
a->rect.x = xoff;
! a->rect.y = AREA_VIEW_Y;
a->rect.height = rect.height - brect.height;
xoff += a->rect.width;
arrange_column(a, False);
diff -Narc wmii-20060504-rc2-slavutych.ORIG/cmd/wm/wm.c
wmii-20060504-rc2-slavutych/cmd/wm/wm.c
*** wmii-20060504-rc2-slavutych.ORIG/cmd/wm/wm.c 2006-05-04
15:02:14.000000000 +0200
--- wmii-20060504-rc2-slavutych/cmd/wm/wm.c 2006-05-04 18:41:56.862930352
+0200
***************
*** 321,327 ****
brect = rect;
brect.height = height_of_bar();
! brect.y = rect.height - brect.height;
barwin = XCreateWindow(dpy, RootWindow(dpy, screen), brect.x, brect.y,
brect.width, brect.height, 0, DefaultDepth(dpy, screen),
CopyFromParent, DefaultVisual(dpy, screen),
--- 321,327 ----
brect = rect;
brect.height = height_of_bar();
! 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 -Narc wmii-20060504-rc2-slavutych.ORIG/cmd/wm/wm.h
wmii-20060504-rc2-slavutych/cmd/wm/wm.h
*** wmii-20060504-rc2-slavutych.ORIG/cmd/wm/wm.h 2006-05-04
15:02:14.000000000 +0200
--- wmii-20060504-rc2-slavutych/cmd/wm/wm.h 2006-05-04 18:40:25.570146210
+0200
***************
*** 10,15 ****
--- 10,23 ----
#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 -Narc wmii-20060504-rc2-slavutych.ORIG/cmd/wmiimenu.c
wmii-20060504-rc2-slavutych/cmd/wmiimenu.c
*** wmii-20060504-rc2-slavutych.ORIG/cmd/wmiimenu.c 2006-05-04
15:02:14.000000000 +0200
--- wmii-20060504-rc2-slavutych/cmd/wmiimenu.c 2006-05-04 17:11:32.021816881
+0200
***************
*** 20,25 ****
--- 20,31 ----
#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;
***************
*** 365,371 ****
mrect.width = DisplayWidth(dpy, screen);
mrect.height = draw.font.ascent + draw.font.descent + 4;
! mrect.y = DisplayHeight(dpy, screen) - mrect.height;
mrect.x = 0;
win = XCreateWindow(dpy, RootWindow(dpy, screen), mrect.x, mrect.y,
--- 371,377 ----
mrect.width = DisplayWidth(dpy, screen);
mrect.height = draw.font.ascent + draw.font.descent + 4;
! mrect.y = MENU_Y;
mrect.x = 0;
win = XCreateWindow(dpy, RootWindow(dpy, screen), mrect.x, mrect.y,
diff -Narc wmii-20060504-rc2-slavutych.ORIG/config.mk
wmii-20060504-rc2-slavutych/config.mk
*** wmii-20060504-rc2-slavutych.ORIG/config.mk 2006-05-04 15:02:14.000000000
+0200
--- wmii-20060504-rc2-slavutych/config.mk 2006-05-04 17:30:24.365840607
+0200
***************
*** 9,21 ****
X11LIB = /usr/X11R6/lib
VERSION = 20060504-rc2-slavutych
# includes and libs
LIBS = -L${PREFIX}/lib -L/usr/lib -lc -L${X11LIB} -lX11
# Linux/BSD
CFLAGS = -g -Wall -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
! -DVERSION=\"${VERSION}\"
LDFLAGS = -g ${LIBS}
# Solaris
--- 9,22 ----
X11LIB = /usr/X11R6/lib
VERSION = 20060504-rc2-slavutych
+ BAR_ON_TOP = 0
# includes and libs
LIBS = -L${PREFIX}/lib -L/usr/lib -lc -L${X11LIB} -lX11
# Linux/BSD
CFLAGS = -g -Wall -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
! -DVERSION=\"${VERSION}\" -DBAR_ON_TOP=${BAR_ON_TOP}
LDFLAGS = -g ${LIBS}
# Solaris
_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii