wmii

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

commit ecbffad57ae6e789f9eacc96b31dae7e4607e564
parent d0a06fe945e8f0f424430ab370e2385ad9297afb
Author: Kris Maglione <jg@suckless.org>
Date:   Fri,  1 Jun 2007 03:10:42 -0400

Fix the bothced merge.

Diffstat:
DISTRIBUTERS | 42------------------------------------------
Makefile | 6++++++
cmd/wmii/column.c | 2--
cmd/wmii/fs.c | 28++++++++++++++++++++++++++--
cmd/wmii/main.c | 42++++--------------------------------------
cmd/wmii/mouse.c | 10++++++++--
cmd/wmii/view.c | 16+++++++++-------
config.mk | 2++
debian/changelog | 2+-
rc/wmiirc.sh | 7++-----
10 files changed, 58 insertions(+), 99 deletions(-)

diff --git a/DISTRIBUTERS b/DISTRIBUTERS @@ -1,42 +0,0 @@ -The following conditions apply to any distribution which -uses the name wmii. These conditions apply only to wmii -name, and not to its source code or any other materials. - -When in doubt about any of these conditions or other matters -of packaging or distrobution, , please contact the wmii -mailing lists <wmii-hackers@suckless.org> or -<wmii@suckless.org>, or Kris Maglione <fbsdaemon@gmail.com>. - -Any binary distribution of wmii MUST have a properly set -version string. This string may normally be set in -'mk/wmii.mk', and is set automatically to the Mercurial -revision number for builds from a Mercurial tree, so long as -the 'hg' command is present and properly functioning. - -Any version which not an official release or snapshot MUST -be contain the hg revision number in its version string. -This SHOULD be formated as hgXXXX, where XXXX is the decimal -revision number. - -The version string of any snapshot release MUST contain the -date of the snapshot in the form YYYYMMDD, and SHOULD -contain the word snap or snapshot. The version string of a -snapshot MAY contain the version of a full release that the -snapshot is expected to lead to, but it MUST be either -directly preceded, or directly followed by, the word 'pre', -optionally separated by a non-alphanumeric character, -including -~_,./, the version. - -Any binary distribution which is modified in any non-trivial -way MUST signify the modifications in its name or version -string. This includes patches to use Xft for font display, -but does NOT include minor patches to improve consistency -with the rest of the system, including changing the default -terminal emulator or changing any build flags as set in -config.mk. - -Source form distribution MAY include non-trivial patches -without such modifications, provided that the user is made -clearly aware of them at build time and/or prompted in some -way to enable or disable them. - diff --git a/Makefile b/Makefile @@ -12,6 +12,12 @@ DIRS = \ config: ROOT="${ROOT}" ${ROOT}/util/genconfig +deb-dep: + apt-get install build-essential debhelper libxext-dev x11proto-xext-dev libx11-dev + +deb: + dpkg-buildpackage -rfakeroot + include ${ROOT}/mk/dir.mk INSTDIRS = ${PDIRS} diff --git a/cmd/wmii/column.c b/cmd/wmii/column.c @@ -424,8 +424,6 @@ resize_colframe(Frame *f, Rectangle *r) { al = a->prev; ar = a->next; - for(al = v->area->next; al; al = al->next) - if(al->next == a) break; if(al) r->min.x = max(r->min.x, al->r.min.x + minw); diff --git a/cmd/wmii/fs.c b/cmd/wmii/fs.c @@ -214,6 +214,7 @@ static void data_to_cstring(Ixp9Req *r) { char *p; uint i; + i = r->ifcall.count; p = r->ifcall.data; if(p[i - 1] == '\n') @@ -234,7 +235,30 @@ message(Ixp9Req *r, MsgFunc fn) { f = r->fid->aux; -void + data_to_cstring(r); + s = r->ifcall.data; + + err = nil; + c = *s; + while(c != '\0') { + while(*s == '\n') + s++; + p = s; + while(*p != '\0' && *p != '\n') + p++; + c = *p; + *p = '\0'; + + m = ixp_message(s, p-s, 0); + s = fn(f->p.ref, &m); + if(s) + err = s; + s = p + 1; + } + return err; +} + +static void respond_event(Ixp9Req *r) { FileId *f = r->fid->aux; if(f->p.buf) { @@ -869,7 +893,7 @@ fs_clunk(Ixp9Req *r) { ft = *fl; *fl = (*fl)->next; f = ft->fid->aux; - free(f->content.buf); + free(f->p.buf); free(ft); break; } diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c @@ -471,44 +471,10 @@ main(int argc, char *argv[]) { | LeaveWindowMask | FocusChangeMask; wa.cursor = cursor[CurNormal]; - XChangeWindowAttributes(blz.dpy, blz.root, CWEventMask | CWCursor, &wa); - wa.override_redirect = 1; - wa.background_pixmap = ParentRelative; - wa.event_mask = - ExposureMask - | ButtonReleaseMask - | FocusChangeMask - | SubstructureRedirectMask - | SubstructureNotifyMask; - s->brect = s->rect; - s->brect.height = labelh(&def.font); - s->brect.y = s->rect.height - s->brect.height; - s->barwin = XCreateWindow( - /* display */ blz.dpy, - /* parent */ RootWindow(blz.dpy, blz.screen), - /* x */ s->brect.x, - /* y */ s->brect.y, - /* width */ s->brect.width, - /* height */ s->brect.height, - /*border_width*/0, - /* depth */ DefaultDepth(blz.dpy, blz.screen), - /* class */ CopyFromParent, - /* visual */ DefaultVisual(blz.dpy, blz.screen), - /* valuemask */ CWOverrideRedirect | CWBackPixmap | CWEventMask, - /* attrubutes */&wa - ); - XSync(blz.dpy, False); - s->bbrush.blitz = &blz; - s->bbrush.gc = XCreateGC(blz.dpy, s->barwin, 0, 0); - s->bbrush.drawable = pmap; - s->bbrush.rect = s->brect; - s->bbrush.rect.x = 0; - s->bbrush.rect.y = 0; - s->bbrush.color = def.normcolor; - s->bbrush.font = &def.font; - s->bbrush.border = 1; - draw_bar(s); - XMapRaised(blz.dpy, s->barwin); + setwinattr(&scr.root, &wa, + CWEventMask + | CWCursor); + initbar(s); } str = "This app is broken. Disable its transparency feature."; diff --git a/cmd/wmii/mouse.c b/cmd/wmii/mouse.c @@ -87,7 +87,10 @@ framewin(Frame *f, Point pt, int or, int n) { return fw; } - return ret ^ *mask; +static void +framedestroy(Framewin *f) { + destroywindow(f->w); + free(f); } static void @@ -228,6 +231,8 @@ do_managed_move(Client *c) { Rectangle r; WinAttr wa; XEvent ev; + Framewin *fw; + Window *cwin; Frame *f; Point pt, pt2; int y; @@ -500,7 +505,7 @@ done: void mouse_resizecol(Divide *d) { - XSetWindowAttributes wa; + WinAttr wa; XEvent ev; Window *cwin; Divide *dp; @@ -663,6 +668,7 @@ do_mouse_resize(Client *c, Bool opaque, Align align) { Cursor cur; Point d, pt, hr; float rx, ry, hrx, hry; + uint num; Frame *f; f = c->sel; diff --git a/cmd/wmii/view.c b/cmd/wmii/view.c @@ -73,7 +73,8 @@ create_view(const char *name) { focus_area(v->area->next); for(i=&view; *i; i=&(*i)->next) - if(strcmp((*i)->name, name) < 0) break; + if(strcmp((*i)->name, name) < 0) + break; v->next = *i; *i = v; @@ -96,6 +97,7 @@ destroy_view(View *v) { *i = v->next; write_event("DestroyTag %s\n", v->name); + if(v == screen->sel) { for(tv=view; tv; tv=tv->next) if(tv->next == *i) break; @@ -158,7 +160,7 @@ select_view(const char *arg) { if(strlen(buf) == 0) return; - if(!strncmp(buf, ".", 2) || !strncmp(buf, "..", 3)) + if(!strcmp(buf, ".") || !strcmp(buf, "..")) return; assign_sel_view(get_view(buf)); @@ -258,13 +260,13 @@ scale_view(View *v, int w) { a->r.max.x = xoff + Dx(a->r) * scale; a->r.min.x = xoff; if(!a->next) - a->rect.width = w - xoff; - xoff += a->rect.width; + a->r.max.x = w; + xoff = a->r.max.x; } /* minwidth can only be respected when there is enough space; * the caller should guarantee this */ - if(num_col * min_width > w) + if(numcol * minwidth > w) return; dx = numcol * minwidth; @@ -303,7 +305,7 @@ arrange_view(View *v) { update_divs(); } -XRectangle * +Rectangle * rects_of_view(View *v, uint *num, Frame *ignore) { Rectangle *result; Frame *f; @@ -407,7 +409,7 @@ newcolw(View *v, int num) { strcpy(buf, r->value); n = tokenize(toks, 16, buf, '+'); - if(n > num) + if(num < n) if(sscanf(toks[num], "%u", &n) == 1) return Dx(screen->r) * (n / 100.0); break; diff --git a/config.mk b/config.mk @@ -17,6 +17,7 @@ include ${ROOT}/mk/gcc.mk CFLAGS += -g -O0 LDFLAGS += -g ${LIBS} STATIC = -static +MKDEP = cpp -M # Compiler CC = cc -c @@ -30,6 +31,7 @@ INCX11 = -I/usr/X11R6/include LIBX11 = -L/usr/X11R6/lib -lX11 LIBICONV = # Leave blank if your libc includes iconv (glibc does) LIBIXP = ${ROOT}/libixp/libixp.a +LIBIXP = ${LIBDIR}/libixp.a # Solaris #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" diff --git a/debian/changelog b/debian/changelog @@ -1,4 +1,4 @@ -wmii (3.6pre~20070508) unstable; urgency=low +wmii (3.6pre~20070516) unstable; urgency=low * First commit of debian directory. diff --git a/rc/wmiirc.sh b/rc/wmiirc.sh @@ -223,11 +223,8 @@ actionlist() { conf_which() { which=$(which which) - prog=$(PATH="$WMII_CONFPATH" $which $1) - shift - if [ -n "$prog" ]; then - $prog - fi + prog=$(PATH="$WMII_CONFPATH" $which $1); shift + [ -n "$prog" ] && $prog "$@" } # Stop any running instances of wmiirc