summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-09-12 10:57:28 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-09-12 10:57:28 +0200
commitca65478c8968434c78aacf4a102ccbbe4a66ad9e (patch)
treea7b8e02be5fb457e1c3f0e646e212911048390b6 /client.c
parentsome more simplifications of intro comment in dwm.h, this should suffice for ... (diff)
downloaddwm-ca65478c8968434c78aacf4a102ccbbe4a66ad9e.tar.gz
dwm-ca65478c8968434c78aacf4a102ccbbe4a66ad9e.zip
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Diffstat (limited to '')
-rw-r--r--client.c50
1 files changed, 16 insertions, 34 deletions
diff --git a/client.c b/client.c
index a794f44..956b13f 100644
--- a/client.c
+++ b/client.c
@@ -11,16 +11,14 @@
11/* static functions */ 11/* static functions */
12 12
13static void 13static void
14detachstack(Client *c) 14detachstack(Client *c) {
15{
16 Client **tc; 15 Client **tc;
17 for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext); 16 for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
18 *tc = c->snext; 17 *tc = c->snext;
19} 18}
20 19
21static void 20static void
22grabbuttons(Client *c, Bool focused) 21grabbuttons(Client *c, Bool focused) {
23{
24 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 22 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
25 23
26 if(focused) { 24 if(focused) {
@@ -54,12 +52,10 @@ grabbuttons(Client *c, Bool focused)
54 else 52 else
55 XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, BUTTONMASK, 53 XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, BUTTONMASK,
56 GrabModeAsync, GrabModeSync, None, None); 54 GrabModeAsync, GrabModeSync, None, None);
57
58} 55}
59 56
60static void 57static void
61resizetitle(Client *c) 58resizetitle(Client *c) {
62{
63 c->tw = textw(c->name); 59 c->tw = textw(c->name);
64 if(c->tw > c->w) 60 if(c->tw > c->w)
65 c->tw = c->w + 2; 61 c->tw = c->w + 2;
@@ -69,27 +65,23 @@ resizetitle(Client *c)
69 XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); 65 XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
70 else 66 else
71 XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); 67 XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th);
72
73} 68}
74 69
75static int 70static int
76xerrordummy(Display *dsply, XErrorEvent *ee) 71xerrordummy(Display *dsply, XErrorEvent *ee) {
77{
78 return 0; 72 return 0;
79} 73}
80 74
81/* extern functions */ 75/* extern functions */
82 76
83void 77void
84ban(Client *c) 78ban(Client *c) {
85{
86 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 79 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
87 XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty); 80 XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty);
88} 81}
89 82
90void 83void
91focus(Client *c) 84focus(Client *c) {
92{
93 Client *old; 85 Client *old;
94 86
95 if(!issel) 87 if(!issel)
@@ -119,8 +111,7 @@ focus(Client *c)
119} 111}
120 112
121Client * 113Client *
122getclient(Window w) 114getclient(Window w) {
123{
124 Client *c; 115 Client *c;
125 116
126 for(c = clients; c; c = c->next) 117 for(c = clients; c; c = c->next)
@@ -130,8 +121,7 @@ getclient(Window w)
130} 121}
131 122
132Client * 123Client *
133getctitle(Window w) 124getctitle(Window w) {
134{
135 Client *c; 125 Client *c;
136 126
137 for(c = clients; c; c = c->next) 127 for(c = clients; c; c = c->next)
@@ -141,8 +131,7 @@ getctitle(Window w)
141} 131}
142 132
143void 133void
144gravitate(Client *c, Bool invert) 134gravitate(Client *c, Bool invert) {
145{
146 int dx = 0, dy = 0; 135 int dx = 0, dy = 0;
147 136
148 switch(c->grav) { 137 switch(c->grav) {
@@ -196,8 +185,7 @@ gravitate(Client *c, Bool invert)
196} 185}
197 186
198void 187void
199killclient(Arg *arg) 188killclient(Arg *arg) {
200{
201 if(!sel) 189 if(!sel)
202 return; 190 return;
203 if(sel->proto & PROTODELWIN) 191 if(sel->proto & PROTODELWIN)
@@ -207,8 +195,7 @@ killclient(Arg *arg)
207} 195}
208 196
209void 197void
210manage(Window w, XWindowAttributes *wa) 198manage(Window w, XWindowAttributes *wa) {
211{
212 Client *c; 199 Client *c;
213 Window trans; 200 Window trans;
214 XSetWindowAttributes twa; 201 XSetWindowAttributes twa;
@@ -270,8 +257,7 @@ manage(Window w, XWindowAttributes *wa)
270} 257}
271 258
272void 259void
273resize(Client *c, Bool sizehints, Corner sticky) 260resize(Client *c, Bool sizehints, Corner sticky) {
274{
275 int bottom = c->y + c->h; 261 int bottom = c->y + c->h;
276 int right = c->x + c->w; 262 int right = c->x + c->w;
277 XWindowChanges wc; 263 XWindowChanges wc;
@@ -309,8 +295,7 @@ resize(Client *c, Bool sizehints, Corner sticky)
309} 295}
310 296
311void 297void
312updatesize(Client *c) 298updatesize(Client *c) {
313{
314 long msize; 299 long msize;
315 XSizeHints size; 300 XSizeHints size;
316 301
@@ -348,8 +333,7 @@ updatesize(Client *c)
348} 333}
349 334
350void 335void
351updatetitle(Client *c) 336updatetitle(Client *c) {
352{
353 char **list = NULL; 337 char **list = NULL;
354 int n; 338 int n;
355 XTextProperty name; 339 XTextProperty name;
@@ -376,8 +360,7 @@ updatetitle(Client *c)
376} 360}
377 361
378void 362void
379togglemax(Arg *arg) 363togglemax(Arg *arg) {
380{
381 int ox, oy, ow, oh; 364 int ox, oy, ow, oh;
382 Client *c; 365 Client *c;
383 XEvent ev; 366 XEvent ev;
@@ -412,8 +395,7 @@ togglemax(Arg *arg)
412} 395}
413 396
414void 397void
415unmanage(Client *c) 398unmanage(Client *c) {
416{
417 Client *nc; 399 Client *nc;
418 400
419 XGrabServer(dpy); 401 XGrabServer(dpy);