[hackers] [wmii] Don't focus dock or splash windows except via EWMH ACTIVE_WINDOW requests. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Thu, 27 May 2010 18:14:50 +0000 (UTC)

changeset: 2652:074ee20e0679
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Thu May 27 14:14:37 2010 -0400
files: cmd/wmii/client.c cmd/wmii/dat.h cmd/wmii/ewmh.c cmd/wmii/fns.h cmd/wmii/frame.c mk/gcc.mk
description:
Don't focus dock or splash windows except via EWMH ACTIVE_WINDOW requests.

diff -r 49542cab138a -r 074ee20e0679 cmd/wmii/client.c
--- a/cmd/wmii/client.c Thu May 27 13:55:34 2010 -0400
+++ b/cmd/wmii/client.c Thu May 27 14:14:37 2010 -0400
@@ -475,7 +475,9 @@
         View *v;
         Frame *f;
 
- USED(user);
+ if(!user && c->nofocus)
+ return;
+
         f = c->sel;
         if(!f)
                 return;
diff -r 49542cab138a -r 074ee20e0679 cmd/wmii/dat.h
--- a/cmd/wmii/dat.h Thu May 27 13:55:34 2010 -0400
+++ b/cmd/wmii/dat.h Thu May 27 14:14:37 2010 -0400
@@ -161,6 +161,7 @@
         bool urgent;
         bool borderless;
         bool titleless;
+ bool nofocus;
         bool noinput;
 };
 
diff -r 49542cab138a -r 074ee20e0679 cmd/wmii/ewmh.c
--- a/cmd/wmii/ewmh.c Thu May 27 13:55:34 2010 -0400
+++ b/cmd/wmii/ewmh.c Thu May 27 14:14:37 2010 -0400
@@ -242,9 +242,11 @@
 
         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 -r 49542cab138a -r 074ee20e0679 cmd/wmii/fns.h
--- a/cmd/wmii/fns.h Thu May 27 13:55:34 2010 -0400
+++ b/cmd/wmii/fns.h Thu May 27 14:14:37 2010 -0400
@@ -90,7 +90,7 @@
 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 -r 49542cab138a -r 074ee20e0679 cmd/wmii/frame.c
--- a/cmd/wmii/frame.c Thu May 27 13:55:34 2010 -0400
+++ b/cmd/wmii/frame.c Thu May 27 14:14:37 2010 -0400
@@ -221,7 +221,6 @@
                        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 -r 49542cab138a -r 074ee20e0679 mk/gcc.mk
--- a/mk/gcc.mk Thu May 27 13:55:34 2010 -0400
+++ b/mk/gcc.mk Thu May 27 14:14:37 2010 -0400
@@ -23,6 +23,6 @@
         -Wreturn-type \
         -Wstrict-prototypes \
         -Wtrigraphs
-MKDEP = cpp -M
+MKDEP = cpp -MM
 SOCFLAGS += -fPIC
 
Received on Thu May 27 2010 - 18:14:50 UTC

This archive was generated by hypermail 2.2.0 : Thu May 27 2010 - 18:24:04 UTC