summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-14 14:01:12 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-14 14:01:12 +0100
commit3ce8c9f33844a995e79329978db9d2cd3981e032 (patch)
tree58c918da4f17a1d81440cc97f6e031fd3938a58a
parentAdded tag 3.5 for changeset 63ad05e7f9e1 (diff)
downloaddwm-3ce8c9f33844a995e79329978db9d2cd3981e032.tar.gz
dwm-3ce8c9f33844a995e79329978db9d2cd3981e032.zip
added ban() which takes care than a banned window is not banned again... (this reduces the overall ConfigureNotify's to clients)
-rw-r--r--client.c10
-rw-r--r--config.mk2
-rw-r--r--dwm.h3
-rw-r--r--event.c2
-rw-r--r--view.c9
5 files changed, 19 insertions, 7 deletions
diff --git a/client.c b/client.c
index 486efe9..3505e76 100644
--- a/client.c
+++ b/client.c
@@ -68,6 +68,14 @@ xerrordummy(Display *dsply, XErrorEvent *ee) {
68/* extern */ 68/* extern */
69 69
70void 70void
71ban(Client *c) {
72 if(!c || c->isbanned)
73 return;
74 c->isbanned = True;
75 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
76}
77
78void
71configure(Client *c) { 79configure(Client *c) {
72 XConfigureEvent ce; 80 XConfigureEvent ce;
73 81
@@ -190,7 +198,7 @@ manage(Window w, XWindowAttributes *wa) {
190 c->next = clients; 198 c->next = clients;
191 c->snext = stack; 199 c->snext = stack;
192 stack = clients = c; 200 stack = clients = c;
193 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 201 ban(c);
194 XMapWindow(dpy, c->win); 202 XMapWindow(dpy, c->win);
195 setclientstate(c, NormalState); 203 setclientstate(c, NormalState);
196 if(isvisible(c)) 204 if(isvisible(c))
diff --git a/config.mk b/config.mk
index 510fd82..d3a6ffd 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
1# dwm version 1# dwm version
2VERSION = 3.5 2VERSION = 3.6
3 3
4# Customize below to fit your system 4# Customize below to fit your system
5 5
diff --git a/dwm.h b/dwm.h
index 674ab1e..2969ecb 100644
--- a/dwm.h
+++ b/dwm.h
@@ -73,7 +73,7 @@ struct Client {
73 int minax, minay, maxax, maxay; 73 int minax, minay, maxax, maxay;
74 long flags; 74 long flags;
75 unsigned int border; 75 unsigned int border;
76 Bool isfixed, isfloat, ismax; 76 Bool isbanned, isfixed, isfloat, ismax;
77 Bool *tags; 77 Bool *tags;
78 Client *next; 78 Client *next;
79 Client *prev; 79 Client *prev;
@@ -99,6 +99,7 @@ extern Display *dpy;
99extern Window root, barwin; 99extern Window root, barwin;
100 100
101/* client.c */ 101/* client.c */
102extern void ban(Client *c); /* ban c */
102extern void configure(Client *c); /* send synthetic configure event */ 103extern void configure(Client *c); /* send synthetic configure event */
103extern void focus(Client *c); /* focus c, c may be NULL */ 104extern void focus(Client *c); /* focus c, c may be NULL */
104extern Client *getclient(Window w); /* return client of w */ 105extern Client *getclient(Window w); /* return client of w */
diff --git a/event.c b/event.c
index bf69d9e..8c8b997 100644
--- a/event.c
+++ b/event.c
@@ -189,7 +189,7 @@ configurerequest(XEvent *e) {
189 configure(c); 189 configure(c);
190 resize(c, False); 190 resize(c, False);
191 if(!isvisible(c)) 191 if(!isvisible(c))
192 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 192 ban(c);
193 } 193 }
194 else 194 else
195 configure(c); 195 configure(c);
diff --git a/view.c b/view.c
index 8164446..5c06027 100644
--- a/view.c
+++ b/view.c
@@ -55,10 +55,12 @@ dofloat(void) {
55 Client *c; 55 Client *c;
56 56
57 for(c = clients; c; c = c->next) { 57 for(c = clients; c; c = c->next) {
58 if(isvisible(c)) 58 if(isvisible(c)) {
59 c->isbanned = False;
59 resize(c, True); 60 resize(c, True);
61 }
60 else 62 else
61 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 63 ban(c);
62 } 64 }
63 if(!sel || !isvisible(sel)) { 65 if(!sel || !isvisible(sel)) {
64 for(c = stack; c && !isvisible(c); c = c->snext); 66 for(c = stack; c && !isvisible(c); c = c->snext);
@@ -82,6 +84,7 @@ dotile(void) {
82 84
83 for(i = 0, c = clients; c; c = c->next) 85 for(i = 0, c = clients; c; c = c->next)
84 if(isvisible(c)) { 86 if(isvisible(c)) {
87 c->isbanned = False;
85 if(c->isfloat) { 88 if(c->isfloat) {
86 resize(c, True); 89 resize(c, True);
87 continue; 90 continue;
@@ -108,7 +111,7 @@ dotile(void) {
108 i++; 111 i++;
109 } 112 }
110 else 113 else
111 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 114 ban(c);
112 if(!sel || !isvisible(sel)) { 115 if(!sel || !isvisible(sel)) {
113 for(c = stack; c && !isvisible(c); c = c->snext); 116 for(c = stack; c && !isvisible(c); c = c->snext);
114 focus(c); 117 focus(c);