wmii

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

commit 5a6c5c1b4d780ec80663a6b2101e4b53267d4067
parent 8177ac58d70150204eea65863f36d820f485424d
Author: Kris Maglione <kris@suckless.org>
Date:   Thu, 24 Jun 2010 10:39:42 -0400

Set ignoreenter indiscriminantly. Closes issue #196.

Diffstat:
PKGBUILD | 4++--
cmd/wmii/client.c | 15++-------------
cmd/wmii/column.c | 4++--
cmd/wmii/frame.c | 8+++-----
cmd/wmiir.c | 1+
include/stuff/x.h | 3++-
lib/libstuff/event/configurenotify.c | 2++
lib/libstuff/event/destroynotify.c | 2++
lib/libstuff/event/event.c | 1+
lib/libstuff/event/mapnotify.c | 2++
lib/libstuff/event/reparentnotify.c | 2++
lib/libstuff/event/unmapnotify.c | 2++
lib/libstuff/event/xtime.c | 3++-
13 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD @@ -1,13 +1,13 @@ pkgname=wmii-hg -pkgver=2739 +pkgver=2740 pkgrel=1 pkgdesc="The latest hg pull of wmii, a lightweight, dynamic window manager for X11" url="http://wmii.suckless.org" license=(MIT) arch=(i686 x86_64) depends=(libx11 libxinerama libxrandr) -makedepends=(mercurial libixp-hg) +makedepends=(mercurial "libixp-hg>="$(sed -rn <mk/wmii.mk 's/.*IXP_NEEDAPI=([0-9]+).*/\1/p')) optdepends=("plan9port: for use of the alternative plan9port wmiirc" \ "python: for use of the alternative Python wmiirc" \ "ruby-rumai: for use of the alternative Ruby wmiirc" \ diff --git a/cmd/wmii/client.c b/cmd/wmii/client.c @@ -489,6 +489,7 @@ focus(Client *c, bool user) { View *v; Frame *f; + Dprint(DFocus, "focus(%#C, %d)\n", c, user); if(!c->nofocus || user) if((f = c->sel)) { v = f->view; @@ -892,7 +893,7 @@ enter_event(Window *w, void *aux, XCrossingEvent *e) { c = aux; if(e->detail != NotifyInferior) { if(e->detail != NotifyVirtual) - if(e->serial != ignoreenter && disp.focus != c) { + if(e->serial > event_lastconfigure && disp.focus != c) { Dprint(DFocus, "enter_notify([%#C]%s)\n", c, c->name); focus(c, false); } @@ -983,18 +984,6 @@ static Handlers handlers = { .property = property_event, }; -static bool -ignoreenter_event(Window *w, void *aux, XAnyEvent *e) { - ignoreenter = e->serial; - return true; -} - -static Handlers ignorehandlers = { - .map = (bool(*)(Window*, void*, XMapEvent*))ignoreenter_event, - .unmap = (bool(*)(Window*, void*, XUnmapEvent*))ignoreenter_event, - .config = (bool(*)(Window*, void*, XConfigureEvent*))ignoreenter_event, -}; - /* Other */ void client_setviews(Client *c, char **tags) { diff --git a/cmd/wmii/column.c b/cmd/wmii/column.c @@ -294,12 +294,12 @@ column_settle(Area *a) { if(n_uncol == 0) { fprint(2, "%s: Badness: No uncollapsed frames, column %d, view %q\n", - argv0, area_idx(a), a->view->name); + argv0, area_idx(a), a->view->name); return; } if(surplus < 0) fprint(2, "%s: Badness: surplus = %d in column_settle, column %d, view %q\n", - argv0, surplus, area_idx(a), a->view->name); + argv0, surplus, area_idx(a), a->view->name); yoff = a->r.min.y; yoffcr = yoff; diff --git a/cmd/wmii/frame.c b/cmd/wmii/frame.c @@ -205,11 +205,12 @@ enter_event(Window *w, void *aux, XCrossingEvent *e) { c = aux; f = c->sel; if(disp.focus != c || selclient() != c) { + Dprint(DFocus, "%E\n", e); Dprint(DFocus, "enter_notify(f) => [%#C]%s%s\n", f->client, f->client->name, - ignoreenter == e->serial ? " (ignored)" : ""); + e->serial <= event_lastconfigure ? " (ignored)" : ""); if(e->detail != NotifyInferior) - if(e->serial != ignoreenter && !f->collapsed) + if(e->serial > event_lastconfigure && !f->collapsed) focus(f->client, false); } mouse_checkresize(f, Pt(e->x, e->y), false); @@ -225,9 +226,6 @@ expose_event(Window *w, void *aux, XExposeEvent *e) { c = aux; if(c->sel) frame_draw(c->sel); - else - fprint(2, "Badness: Expose event on a client frame which shouldn't be visible: %#C\n", - c); return false; } diff --git a/cmd/wmiir.c b/cmd/wmiir.c @@ -121,6 +121,7 @@ unflush(int fd, char *in, int len, bool binary) { else out += res; } while(n > 0); + if(in < start + len) { nextra = min(sizeof extra, len - (in - start)); memcpy(extra, in, nextra); diff --git a/include/stuff/x.h b/include/stuff/x.h @@ -42,7 +42,7 @@ void event_fdclosed(IxpConn*); void event_fdready(IxpConn*); void event_preselect(IxpServer*); #endif -void event_updatextime(void); +long event_updatextime(void); void event_buttonpress(XButtonPressedEvent*); void event_buttonrelease(XButtonPressedEvent*); @@ -68,6 +68,7 @@ void event_selectionclear(XSelectionClearEvent*); void event_selectionrequest(XSelectionRequestEvent*); void event_unmapnotify(XUnmapEvent*); +extern long event_lastconfigure; extern long event_xtime; extern bool event_looprunning; extern void (*event_debug)(XEvent*); diff --git a/lib/libstuff/event/configurenotify.c b/lib/libstuff/event/configurenotify.c @@ -7,6 +7,8 @@ void event_configurenotify(XConfigureEvent *ev) { Window *w; + if(!ev->send_event) + event_lastconfigure = ev->serial; if((w = findwin(ev->window))) event_handle(w, config, ev); } diff --git a/lib/libstuff/event/destroynotify.c b/lib/libstuff/event/destroynotify.c @@ -7,6 +7,8 @@ void event_destroynotify(XDestroyWindowEvent *ev) { Window *w; + if(!ev->send_event) + event_lastconfigure = ev->serial; if((w = findwin(ev->window))) event_handle(w, destroy, ev); } diff --git a/lib/libstuff/event/event.c b/lib/libstuff/event/event.c @@ -5,6 +5,7 @@ typedef bool (*Handler)(Window*, void*, XEvent*); void (*event_debug)(XEvent*); +long event_lastconfigure; long event_xtime; bool event_looprunning; diff --git a/lib/libstuff/event/mapnotify.c b/lib/libstuff/event/mapnotify.c @@ -7,6 +7,8 @@ void event_mapnotify(XMapEvent *ev) { Window *w; + if(!ev->send_event) + event_lastconfigure = ev->serial; if((w = findwin(ev->event))) event_handle(w, map, ev); if(ev->send_event && (w = findwin(ev->event))) diff --git a/lib/libstuff/event/reparentnotify.c b/lib/libstuff/event/reparentnotify.c @@ -7,6 +7,8 @@ void event_reparentnotify(XReparentEvent *ev) { Window *target, *w; + if(!ev->send_event) + event_lastconfigure = ev->serial; w = nil; if((target = findwin(ev->window)) && (w = findwin(ev->parent))) target->parent = w; diff --git a/lib/libstuff/event/unmapnotify.c b/lib/libstuff/event/unmapnotify.c @@ -7,6 +7,8 @@ void event_unmapnotify(XUnmapEvent *ev) { Window *w; + if(!ev->send_event) + event_lastconfigure = ev->serial; if((w = findwin(ev->window))) { if(!ev->send_event) w->mapped = false; diff --git a/lib/libstuff/event/xtime.c b/lib/libstuff/event/xtime.c @@ -15,7 +15,7 @@ findtime(Display *d, XEvent *e, XPointer v) { return false; } -void +long event_updatextime(void) { Window *w; WinAttr wa; @@ -29,5 +29,6 @@ event_updatextime(void) { XIfEvent(display, &e, findtime, (void*)w); destroywindow(w); + return event_xtime; }