[hackers] [wmii] Set ignoreenter indiscriminantly. Closes issue #196. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Thu, 24 Jun 2010 15:04:19 +0000 (UTC)

changeset: 2741:a4cc538b2fb8
user: Kris Maglione <kris_AT_suckless.org>
date: Thu Jun 24 10:39:42 2010 -0400
files: PKGBUILD cmd/wmii/client.c cmd/wmii/column.c cmd/wmii/frame.c cmd/wmiir.c include/stuff/x.h lib/libstuff/event/configurenotify.c lib/libstuff/event/destroynotify.c lib/libstuff/event/event.c lib/libstuff/event/mapnotify.c lib/libstuff/event/reparentnotify.c lib/libstuff/event/unmapnotify.c lib/libstuff/event/xtime.c
description:
Set ignoreenter indiscriminantly. Closes issue #196.

diff -r 77fc56d9cf58 -r a4cc538b2fb8 PKGBUILD
--- a/PKGBUILD Wed Jun 23 10:55:55 2010 -0400
+++ b/PKGBUILD Thu Jun 24 10:39:42 2010 -0400
@@ -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 -r 77fc56d9cf58 -r a4cc538b2fb8 cmd/wmii/client.c
--- a/cmd/wmii/client.c Wed Jun 23 10:55:55 2010 -0400
+++ b/cmd/wmii/client.c Thu Jun 24 10:39:42 2010 -0400
@@ -489,6 +489,7 @@
         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 @@
         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 @@
         .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 -r 77fc56d9cf58 -r a4cc538b2fb8 cmd/wmii/column.c
--- a/cmd/wmii/column.c Wed Jun 23 10:55:55 2010 -0400
+++ b/cmd/wmii/column.c Thu Jun 24 10:39:42 2010 -0400
@@ -294,12 +294,12 @@
 
         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 -r 77fc56d9cf58 -r a4cc538b2fb8 cmd/wmii/frame.c
--- a/cmd/wmii/frame.c Wed Jun 23 10:55:55 2010 -0400
+++ b/cmd/wmii/frame.c Thu Jun 24 10:39:42 2010 -0400
@@ -205,11 +205,12 @@
         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 @@
         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 -r 77fc56d9cf58 -r a4cc538b2fb8 cmd/wmiir.c
--- a/cmd/wmiir.c Wed Jun 23 10:55:55 2010 -0400
+++ b/cmd/wmiir.c Thu Jun 24 10:39:42 2010 -0400
@@ -121,6 +121,7 @@
                 else
                         out += res;
         } while(n > 0);
+
         if(in < start + len) {
                 nextra = min(sizeof extra, len - (in - start));
                 memcpy(extra, in, nextra);
diff -r 77fc56d9cf58 -r a4cc538b2fb8 include/stuff/x.h
--- a/include/stuff/x.h Wed Jun 23 10:55:55 2010 -0400
+++ b/include/stuff/x.h Thu Jun 24 10:39:42 2010 -0400
@@ -42,7 +42,7 @@
 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_selectionrequest(XSelectionRequestEvent*);
 void event_unmapnotify(XUnmapEvent*);
 
+extern long event_lastconfigure;
 extern long event_xtime;
 extern bool event_looprunning;
 extern void (*event_debug)(XEvent*);
diff -r 77fc56d9cf58 -r a4cc538b2fb8 lib/libstuff/event/configurenotify.c
--- a/lib/libstuff/event/configurenotify.c Wed Jun 23 10:55:55 2010 -0400
+++ b/lib/libstuff/event/configurenotify.c Thu Jun 24 10:39:42 2010 -0400
@@ -7,6 +7,8 @@
 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 -r 77fc56d9cf58 -r a4cc538b2fb8 lib/libstuff/event/destroynotify.c
--- a/lib/libstuff/event/destroynotify.c Wed Jun 23 10:55:55 2010 -0400
+++ b/lib/libstuff/event/destroynotify.c Thu Jun 24 10:39:42 2010 -0400
@@ -7,6 +7,8 @@
 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 -r 77fc56d9cf58 -r a4cc538b2fb8 lib/libstuff/event/event.c
--- a/lib/libstuff/event/event.c Wed Jun 23 10:55:55 2010 -0400
+++ b/lib/libstuff/event/event.c Thu Jun 24 10:39:42 2010 -0400
@@ -5,6 +5,7 @@
 
 typedef bool (*Handler)(Window*, void*, XEvent*);
 void (*event_debug)(XEvent*);
+long event_lastconfigure;
 long event_xtime;
 bool event_looprunning;
 
diff -r 77fc56d9cf58 -r a4cc538b2fb8 lib/libstuff/event/mapnotify.c
--- a/lib/libstuff/event/mapnotify.c Wed Jun 23 10:55:55 2010 -0400
+++ b/lib/libstuff/event/mapnotify.c Thu Jun 24 10:39:42 2010 -0400
@@ -7,6 +7,8 @@
 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 -r 77fc56d9cf58 -r a4cc538b2fb8 lib/libstuff/event/reparentnotify.c
--- a/lib/libstuff/event/reparentnotify.c Wed Jun 23 10:55:55 2010 -0400
+++ b/lib/libstuff/event/reparentnotify.c Thu Jun 24 10:39:42 2010 -0400
@@ -7,6 +7,8 @@
 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 -r 77fc56d9cf58 -r a4cc538b2fb8 lib/libstuff/event/unmapnotify.c
--- a/lib/libstuff/event/unmapnotify.c Wed Jun 23 10:55:55 2010 -0400
+++ b/lib/libstuff/event/unmapnotify.c Thu Jun 24 10:39:42 2010 -0400
@@ -7,6 +7,8 @@
 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 -r 77fc56d9cf58 -r a4cc538b2fb8 lib/libstuff/event/xtime.c
--- a/lib/libstuff/event/xtime.c Wed Jun 23 10:55:55 2010 -0400
+++ b/lib/libstuff/event/xtime.c Thu Jun 24 10:39:42 2010 -0400
@@ -15,7 +15,7 @@
         return false;
 }
 
-void
+long
 event_updatextime(void) {
         Window *w;
         WinAttr wa;
@@ -29,5 +29,6 @@
         XIfEvent(display, &e, findtime, (void*)w);
 
         destroywindow(w);
+ return event_xtime;
 }
 
Received on Thu Jun 24 2010 - 15:04:19 UTC

This archive was generated by hypermail 2.2.0 : Thu Jun 24 2010 - 15:12:04 UTC