wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit a36288c7e55e2bb43ab35fc53b736dc2e06a2c7e
parent cb7bfcf1f2a2a1c136858bd6399b73e0c0e109d4
Author: Sander van Dijk <sander@wmii.de>
Date:   Thu, 25 May 2006 00:02:17 +0000

simplification in wmiimenu


Diffstat:
cmd/wmiimenu.1 | 4++--
cmd/wmiimenu.c | 19+++++++------------
config.mk | 1-
3 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/cmd/wmiimenu.1 b/cmd/wmiimenu.1 @@ -5,7 +5,7 @@ wmiimenu \- window manager improved 2 menu .B wmiimenu .RB [ \-v ] .RB [ \-t -.IR <title> ] +.IR title ] .SH DESCRIPTION .SS Overview .B wmiimenu @@ -18,7 +18,7 @@ It supports arbitrary, user defined menu contents. .B \-v prints version information to stdout, then exits. .TP -.BI \-t\ <title> +.BI \-t " title" displays .I title above the menu. diff --git a/cmd/wmiimenu.c b/cmd/wmiimenu.c @@ -135,7 +135,7 @@ draw_menu() draw.rect = irect; draw.rect.x = 0; - draw.rect.y = trect.height; + draw.rect.y = title ? trect.height : 0; draw.color = normcolor; draw.data = nil; blitz_drawlabel(dpy, &draw); @@ -405,18 +405,13 @@ main(int argc, char *argv[]) trect.height = draw.font.ascent + draw.font.descent + 4; trect.y = DisplayHeight(dpy, screen) - (irect.height + trect.height); trect.x = 0; + mrect.width = DisplayWidth(dpy, screen); + mrect.height = irect.height + trect.height; + mrect.y = DisplayHeight(dpy, screen) - mrect.height; + mrect.x = 0; } - else { - trect.width = DisplayWidth(dpy, screen); - trect.height = 0; - trect.y = irect.y; - trect.x = 0; - } - - mrect.width = DisplayWidth(dpy, screen); - mrect.height = irect.height + trect.height; - mrect.y = DisplayHeight(dpy, screen) - mrect.height; - mrect.x = 0; + else + mrect = irect; win = XCreateWindow(dpy, RootWindow(dpy, screen), mrect.x, mrect.y, mrect.width, mrect.height, 0, DefaultDepth(dpy, screen), diff --git a/config.mk b/config.mk @@ -18,7 +18,6 @@ CFLAGS = -g -Wall -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ -DVERSION=\"${VERSION}\" LDFLAGS = -g ${LIBS} - # Solaris #CFLAGS = -fast -xtarget=ultra ${INCLUDES} -DVERSION=\"${VERSION}\" #LIBS += -lnsl -lsocket