From 8c5e6b9eb9b84182f4a939c2d4671b4de84db6b4 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 27 May 2010 14:14:37 -0400 Subject: [PATCH] Don't focus dock or splash windows except via EWMH ACTIVE_WINDOW requests. --- cmd/wmii/client.c | 4 +++- cmd/wmii/dat.h | 1 + cmd/wmii/ewmh.c | 6 ++++-- cmd/wmii/fns.h | 2 +- cmd/wmii/frame.c | 1 - mk/gcc.mk | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cmd/wmii/client.c b/cmd/wmii/client.c index bc1129a7..dca76e69 100644 --- a/cmd/wmii/client.c +++ b/cmd/wmii/client.c @@ -475,7 +475,9 @@ focus(Client *c, bool user) { View *v; Frame *f; - USED(user); + if(!user && c->nofocus) + return; + f = c->sel; if(!f) return; diff --git a/cmd/wmii/dat.h b/cmd/wmii/dat.h index bc01d9a9..d58c1670 100644 --- a/cmd/wmii/dat.h +++ b/cmd/wmii/dat.h @@ -161,6 +161,7 @@ struct Client { bool urgent; bool borderless; bool titleless; + bool nofocus; bool noinput; }; diff --git a/cmd/wmii/ewmh.c b/cmd/wmii/ewmh.c index efaba969..306334a8 100644 --- a/cmd/wmii/ewmh.c +++ b/cmd/wmii/ewmh.c @@ -242,9 +242,11 @@ ewmh_getwintype(Client *c) { c->w.ewmh.type = mask; if(mask & (TypeDock|TypeMenu|TypeToolbar)) { - c->borderless = 1; - c->titleless = 1; + c->borderless = true; + c->titleless = true; } + if(mask & (TypeSplash|TypeDock)) + c->nofocus = true; } static void diff --git a/cmd/wmii/fns.h b/cmd/wmii/fns.h index 0622fe5c..dbd5d8bd 100644 --- a/cmd/wmii/fns.h +++ b/cmd/wmii/fns.h @@ -90,7 +90,7 @@ void client_seturgent(Client*, int, int); void client_setviews(Client*, char**); void client_unmap(Client*, int state); Frame* client_viewframe(Client *c, View *v); -void focus(Client*, bool restack); +void focus(Client*, bool user); void fullscreen(Client*, int, long); Client* group_leader(Group*); int map_frame(Client*); diff --git a/cmd/wmii/frame.c b/cmd/wmii/frame.c index 8656360f..b6e5d6f9 100644 --- a/cmd/wmii/frame.c +++ b/cmd/wmii/frame.c @@ -221,7 +221,6 @@ enter_event(Window *w, void *aux, XCrossingEvent *e) { ignoreenter == e->serial ? " (ignored)" : ""); if(e->detail != NotifyInferior) if(e->serial != ignoreenter && (f->area->floating || !f->collapsed)) - if(!(c->w.ewmh.type & TypeSplash)) focus(f->client, false); } mouse_checkresize(f, Pt(e->x, e->y), false); diff --git a/mk/gcc.mk b/mk/gcc.mk index 259eff43..1001d782 100644 --- a/mk/gcc.mk +++ b/mk/gcc.mk @@ -23,6 +23,6 @@ CFLAGS += \ -Wreturn-type \ -Wstrict-prototypes \ -Wtrigraphs -MKDEP = cpp -M +MKDEP = cpp -MM SOCFLAGS += -fPIC