annotate view.c @ 443:548084f8d92e

this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
author Anselm R. Garbe <arg@10kloc.org>
date Wed, 06 Sep 2006 17:31:52 +0200
parents 056a5072c70a
children a2e587651c79
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
1 /*
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
3 * See LICENSE file for license details.
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
4 */
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
5 #include "dwm.h"
382
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
6 #include <stdio.h>
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
7
380
4bf79305d675 this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents: 378
diff changeset
8 /* static */
4bf79305d675 this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents: 378
diff changeset
9
382
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
10 static Client *
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
11 minclient()
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
12 {
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
13 Client *c, *min;
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
14
443
548084f8d92e this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents: 442
diff changeset
15 if((clients && clients->isfloat) || arrange == dofloat)
548084f8d92e this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents: 442
diff changeset
16 return clients; /* don't touch floating order */
382
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
17 for(min = c = clients; c; c = c->next)
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
18 if(c->weight < min->weight)
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
19 min = c;
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
20 return min;
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
21 }
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
22
442
056a5072c70a no this is better
Anselm R. Garbe <arg@10kloc.org>
parents: 437
diff changeset
23 static void
381
b00cc483d13b still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents: 380
diff changeset
24 reorder()
380
4bf79305d675 this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents: 378
diff changeset
25 {
382
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
26 Client *c, *newclients, *tail;
381
b00cc483d13b still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents: 380
diff changeset
27
382
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
28 newclients = tail = NULL;
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
29 while((c = minclient())) {
381
b00cc483d13b still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents: 380
diff changeset
30 detach(c);
382
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
31 if(tail) {
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
32 c->prev = tail;
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
33 tail->next = c;
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
34 tail = c;
381
b00cc483d13b still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents: 380
diff changeset
35 }
b00cc483d13b still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents: 380
diff changeset
36 else
382
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
37 tail = newclients = c;
380
4bf79305d675 this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents: 378
diff changeset
38 }
382
76b62c0c8c11 improved selection policy
Anselm R. Garbe <arg@10kloc.org>
parents: 381
diff changeset
39 clients = newclients;
380
4bf79305d675 this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents: 378
diff changeset
40 }
4bf79305d675 this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents: 378
diff changeset
41
430
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
42 static Client *
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
43 nexttiled(Client *c)
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
44 {
433
a6b8994af164 small fix
Anselm R. Garbe <arg@10kloc.org>
parents: 430
diff changeset
45 for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
430
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
46 return c;
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
47 }
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
48
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
49 /* extern */
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
50
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
51 void (*arrange)(Arg *) = DEFMODE;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
52
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
53 void
378
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
54 detach(Client *c)
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
55 {
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
56 if(c->prev)
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
57 c->prev->next = c->next;
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
58 if(c->next)
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
59 c->next->prev = c->prev;
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
60 if(c == clients)
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
61 clients = c->next;
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
62 c->next = c->prev = NULL;
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
63 }
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
64
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
65 void
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
66 dofloat(Arg *arg)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
67 {
402
c7d5ff57998d removed unused vars
Anselm R. Garbe <arg@10kloc.org>
parents: 401
diff changeset
68 Client *c;
400
052657ff2e7b applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents: 397
diff changeset
69
052657ff2e7b applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents: 397
diff changeset
70 maximized = False;
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
71
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
72 for(c = clients; c; c = c->next) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
73 if(isvisible(c)) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
74 resize(c, True, TopLeft);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
75 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
76 else
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
77 ban(c);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
78 }
401
1eb2eb405653 reducing focus calls (sanders patch)
Anselm R. Garbe <arg@10kloc.org>
parents: 400
diff changeset
79 if(!sel || !isvisible(sel))
1eb2eb405653 reducing focus calls (sanders patch)
Anselm R. Garbe <arg@10kloc.org>
parents: 400
diff changeset
80 focus(getnext(clients));
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
81 restack();
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
82 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
83
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
84 void
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
85 dotile(Arg *arg)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
86 {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
87 int h, i, n, w;
402
c7d5ff57998d removed unused vars
Anselm R. Garbe <arg@10kloc.org>
parents: 401
diff changeset
88 Client *c;
400
052657ff2e7b applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents: 397
diff changeset
89
052657ff2e7b applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents: 397
diff changeset
90 maximized = False;
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
91
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
92 w = sw - mw;
430
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
93 for(n = 0, c = clients; c; c = c->next)
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
94 if(isvisible(c) && !c->isfloat)
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
95 n++;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
96
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
97 if(n > 1)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
98 h = (sh - bh) / (n - 1);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
99 else
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
100 h = sh - bh;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
101
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
102 for(i = 0, c = clients; c; c = c->next) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
103 if(isvisible(c)) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
104 if(c->isfloat) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
105 resize(c, True, TopLeft);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
106 continue;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
107 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
108 if(n == 1) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
109 c->x = sx;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
110 c->y = sy + bh;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
111 c->w = sw - 2;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
112 c->h = sh - 2 - bh;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
113 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
114 else if(i == 0) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
115 c->x = sx;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
116 c->y = sy + bh;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
117 c->w = mw - 2;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
118 c->h = sh - 2 - bh;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
119 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
120 else if(h > bh) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
121 c->x = sx + mw;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
122 c->y = sy + (i - 1) * h + bh;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
123 c->w = w - 2;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
124 if(i + 1 == n)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
125 c->h = sh - c->y - 2;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
126 else
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
127 c->h = h - 2;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
128 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
129 else { /* fallback if h < bh */
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
130 c->x = sx + mw;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
131 c->y = sy + bh;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
132 c->w = w - 2;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
133 c->h = sh - 2 - bh;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
134 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
135 resize(c, False, TopLeft);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
136 i++;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
137 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
138 else
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
139 ban(c);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
140 }
401
1eb2eb405653 reducing focus calls (sanders patch)
Anselm R. Garbe <arg@10kloc.org>
parents: 400
diff changeset
141 if(!sel || !isvisible(sel))
1eb2eb405653 reducing focus calls (sanders patch)
Anselm R. Garbe <arg@10kloc.org>
parents: 400
diff changeset
142 focus(getnext(clients));
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
143 restack();
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
144 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
145
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
146 void
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
147 focusnext(Arg *arg)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
148 {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
149 Client *c;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
150
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
151 if(!sel)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
152 return;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
153
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
154 if(!(c = getnext(sel->next)))
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
155 c = getnext(clients);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
156 if(c) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
157 focus(c);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
158 restack();
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
159 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
160 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
161
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
162 void
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
163 focusprev(Arg *arg)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
164 {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
165 Client *c;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
166
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
167 if(!sel)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
168 return;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
169
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
170 if(!(c = getprev(sel->prev))) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
171 for(c = clients; c && c->next; c = c->next);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
172 c = getprev(c);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
173 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
174 if(c) {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
175 focus(c);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
176 restack();
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
177 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
178 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
179
420
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
180 Bool
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
181 isvisible(Client *c)
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
182 {
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
183 unsigned int i;
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
184
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
185 for(i = 0; i < ntags; i++)
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
186 if(c->tags[i] && seltag[i])
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
187 return True;
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
188 return False;
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
189 }
c033e1ade281 s/growcol/resizetile/g
Anselm R. Garbe <arg@10kloc.org>
parents: 419
diff changeset
190
415
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
191 void
422
44225ee80236 renamed resizetile into resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 420
diff changeset
192 resizecol(Arg *arg)
415
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
193 {
423
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
194 unsigned int n;
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
195 Client *c;
418
Anselm R. Garbe <arg@10kloc.org>
parents: 417
diff changeset
196
430
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
197 for(n = 0, c = clients; c; c = c->next)
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
198 if(isvisible(c) && !c->isfloat)
423
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
199 n++;
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
200 if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized)
415
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
201 return;
423
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
202
415
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
203 if(sel == getnext(clients)) {
425
67f37b93ac73 fixing two off-by-ones
Anselm R. Garbe <arg@10kloc.org>
parents: 423
diff changeset
204 if(mw + arg->i > sw - 100 || mw + arg->i < 100)
415
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
205 return;
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
206 mw += arg->i;
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
207 }
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
208 else {
425
67f37b93ac73 fixing two off-by-ones
Anselm R. Garbe <arg@10kloc.org>
parents: 423
diff changeset
209 if(mw - arg->i > sw - 100 || mw - arg->i < 100)
415
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
210 return;
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
211 mw -= arg->i;
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
212 }
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
213 arrange(NULL);
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
214 }
ad2b6ce6e95b I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents: 414
diff changeset
215
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
216 void
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
217 restack()
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
218 {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
219 Client *c;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
220 XEvent ev;
436
b3659c3c5dab sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents: 433
diff changeset
221
437
433a5c662f73 drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents: 436
diff changeset
222 if(!sel) {
433a5c662f73 drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents: 436
diff changeset
223 drawstatus();
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
224 return;
437
433a5c662f73 drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents: 436
diff changeset
225 }
436
b3659c3c5dab sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents: 433
diff changeset
226 if(sel->isfloat || arrange == dofloat) {
b3659c3c5dab sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents: 433
diff changeset
227 XRaiseWindow(dpy, sel->win);
b3659c3c5dab sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents: 433
diff changeset
228 XRaiseWindow(dpy, sel->twin);
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
229 }
436
b3659c3c5dab sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents: 433
diff changeset
230 if(arrange != dofloat)
b3659c3c5dab sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents: 433
diff changeset
231 for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
b3659c3c5dab sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents: 433
diff changeset
232 XLowerWindow(dpy, c->twin);
b3659c3c5dab sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents: 433
diff changeset
233 XLowerWindow(dpy, c->win);
414
c6ffcc201229 don't access sel in restack without checking for NULL (multihead crashing bug)
Anselm R. Garbe <arg@10kloc.org>
parents: 402
diff changeset
234 }
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
235 drawall();
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
236 XSync(dpy, False);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
237 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
238 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
239
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
240 void
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
241 togglemode(Arg *arg)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
242 {
333
827f8f6c9e97 separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents: 327
diff changeset
243 arrange = (arrange == dofloat) ? dotile : dofloat;
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
244 if(sel)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
245 arrange(NULL);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
246 else
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
247 drawstatus();
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
248 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
249
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
250 void
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
251 toggleview(Arg *arg)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
252 {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
253 unsigned int i;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
254
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
255 seltag[arg->i] = !seltag[arg->i];
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
256 for(i = 0; i < ntags && !seltag[i]; i++);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
257 if(i == ntags)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
258 seltag[arg->i] = True; /* cannot toggle last view */
381
b00cc483d13b still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents: 380
diff changeset
259 reorder();
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
260 arrange(NULL);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
261 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
262
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
263 void
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
264 view(Arg *arg)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
265 {
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
266 unsigned int i;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
267
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
268 for(i = 0; i < ntags; i++)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
269 seltag[i] = False;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
270 seltag[arg->i] = True;
381
b00cc483d13b still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents: 380
diff changeset
271 reorder();
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
272 arrange(NULL);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
273 }
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
274
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
275 void
395
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
276 viewall(Arg *arg)
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
277 {
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
278 unsigned int i;
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
279
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
280 for(i = 0; i < ntags; i++)
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
281 seltag[i] = True;
397
cb8a231610c7 reorder was misssing in Ross version of viewall
Anselm R. Garbe <arg@10kloc.org>
parents: 395
diff changeset
282 reorder();
395
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
283 arrange(NULL);
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
284 }
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
285
7528080beb0e added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents: 393
diff changeset
286 void
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
287 zoom(Arg *arg)
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
288 {
423
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
289 unsigned int n;
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
290 Client *c;
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
291
430
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
292 for(n = 0, c = clients; c; c = c->next)
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
293 if(isvisible(c) && !c->isfloat)
423
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
294 n++;
6ba5dd429122 applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents: 422
diff changeset
295 if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized)
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
296 return;
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
297
430
1e8aba00964e no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents: 429
diff changeset
298 if((c = sel) == nexttiled(clients))
433
a6b8994af164 small fix
Anselm R. Garbe <arg@10kloc.org>
parents: 430
diff changeset
299 if(!(c = nexttiled(c->next)))
429
a31de8605f72 no, ordering floating clients at the end seems better
Anselm R. Garbe <arg@10kloc.org>
parents: 428
diff changeset
300 return;
443
548084f8d92e this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents: 442
diff changeset
301 detach(c);
548084f8d92e this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents: 442
diff changeset
302 if(clients)
548084f8d92e this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents: 442
diff changeset
303 clients->prev = c;
548084f8d92e this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents: 442
diff changeset
304 c->next = clients;
548084f8d92e this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents: 442
diff changeset
305 clients = c;
378
83576f5f0a90 added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents: 342
diff changeset
306 focus(c);
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
307 arrange(NULL);
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff changeset
308 }