about summary refs log tree commit diff stats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/dwm.c b/dwm.c
index 997a220..56ca615 100644
--- a/dwm.c
+++ b/dwm.c
@@ -160,7 +160,7 @@ void initfont(const char *fontstr);
 Bool isoccupied(unsigned int t);
 Bool isprotodel(Client *c);
 Bool isurgent(unsigned int t);
-Bool isvisible(Client *c);
+Bool isvisible(Client *c, Bool *cmp);
 void keypress(XEvent *e);
 void killclient(const char *arg);
 void manage(Window w, XWindowAttributes *wa);
@@ -287,7 +287,7 @@ arrange(void) {
 	Client *c;
 
 	for(c = clients; c; c = c->next)
-		if(isvisible(c)) {
+		if(isvisible(c, NULL)) {
 			unban(c);
 			if(lt->isfloating || c->isfloating)
 				resize(c, c->fx, c->fy, c->fw, c->fh, True);
@@ -469,7 +469,7 @@ configurerequest(XEvent *e) {
 			if((ev->value_mask & (CWX|CWY))
 			&& !(ev->value_mask & (CWWidth|CWHeight)))
 				configure(c);
-			if(isvisible(c))
+			if(isvisible(c, NULL))
 				XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
 		}
 		else
@@ -536,7 +536,7 @@ drawbar(void) {
 		drawtext(geom->symbol, dc.norm, False);
 		dc.x += bgw;
 	}
-	for(c = stack; c && !isvisible(c); c = c->snext);
+	for(c = stack; c && !isvisible(c, NULL); c = c->snext);
 	for(i = 0; i < LENGTH(tags); i++) {
 		dc.w = textw(tags[i]);
 		if(tagset[seltags][i]) {
@@ -676,8 +676,8 @@ expose(XEvent *e) {
 
 void
 focus(Client *c) {
-	if(!c || (c && !isvisible(c)))
-		for(c = stack; c && !isvisible(c); c = c->snext);
+	if(!c || (c && !isvisible(c, NULL)))
+		for(c = stack; c && !isvisible(c, NULL); c = c->snext);
 	if(sel && sel != c) {
 		grabbuttons(sel, False);
 		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
@@ -711,9 +711,9 @@ focusnext(const char *arg) {
 
 	if(!sel)
 		return;
-	for(c = sel->next; c && !isvisible(c); c = c->next);
+	for(c = sel->next; c && !isvisible(c, arg ? sel->tags : NULL); c = c->next);
 	if(!c)
-		for(c = clients; c && !isvisible(c); c = c->next);
+		for(c = clients; c && !isvisible(c, arg ? sel->tags : NULL); c = c->next);
 	if(c) {
 		focus(c);
 		restack();
@@ -726,10 +726,10 @@ focusprev(const char *arg) {
 
 	if(!sel)
 		return;
-	for(c = sel->prev; c && !isvisible(c); c = c->prev);
+	for(c = sel->prev; c && !isvisible(c, arg ? sel->tags : NULL); c = c->prev);
 	if(!c) {
 		for(c = clients; c && c->next; c = c->next);
-		for(; c && !isvisible(c); c = c->prev);
+		for(; c && !isvisible(c, arg ? sel->tags : NULL); c = c->prev);
 	}
 	if(c) {
 		focus(c);
@@ -930,11 +930,13 @@ isurgent(unsigned int t) {
 }
 
 Bool
-isvisible(Client *c) {
+isvisible(Client *c, Bool *cmp) {
 	unsigned int i;
 
+	if(!cmp)
+		cmp = tagset[seltags];
 	for(i = 0; i < LENGTH(tags); i++)
-		if(c->tags[i] && tagset[seltags][i])
+		if(c->tags[i] && cmp[i])
 			return True;
 	return False;
 }
@@ -1061,7 +1063,7 @@ monocle(void) {
 	Client *c;
 
 	for(c = clients; c; c = c->next)
-		if((lt->isfloating || !c->isfloating) &&  isvisible(c))
+		if((lt->isfloating || !c->isfloating) &&  isvisible(c, NULL))
 			resize(c, mox, moy, mow - 2 * c->bw, moh - 2 * c->bw, RESIZEHINTS);
 }
 
@@ -1115,7 +1117,7 @@ movemouse(Client *c) {
 
 Client *
 nexttiled(Client *c) {
-	for(; c && (c->isfloating || !isvisible(c)); c = c->next);
+	for(; c && (c->isfloating || !isvisible(c, NULL)); c = c->next);
 	return c;
 }
 
@@ -1292,7 +1294,7 @@ restack(void) {
 		wc.stack_mode = Below;
 		wc.sibling = barwin;
 		for(c = stack; c; c = c->snext)
-			if(!c->isfloating && isvisible(c)) {
+			if(!c->isfloating && isvisible(c, NULL)) {
 				XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
 				wc.sibling = c->win;
 			}
filled square before title means versatile maximized window.' href='/acidbong/suckless/dwm/commit/dwm.1?h=5.3&id=84432e6b36caee444f9e1cd2526b96b288655375'>84432e6 ^
338c083 ^

84432e6 ^

1a25414 ^

b439892 ^
caf5a16 ^
901b3ed ^
1076f2b

901b3ed ^
0c3544d ^
2b35fae ^

a3e3f0b ^

2b35fae ^
3e06ede ^
cdbc84b ^
338c083 ^
292ccc4 ^
d4b7a9a ^
10885d3 ^
1836b67 ^

7ab8c87 ^
1836b67 ^

7ab8c87 ^
2b35fae ^
72655f0 ^
df74b26 ^

0ea0343 ^
72655f0 ^
cb9607c ^
5871008 ^
cb9607c ^
0ea0343 ^
7ab8c87 ^
72655f0 ^
0ea0343 ^
7ab8c87 ^
3af6434 ^
0ea0343 ^
5871008 ^
6499fc4 ^
0ea0343 ^
5871008 ^
9066ee2 ^
8c4623d ^
5871008 ^
06bae9d ^
8c4623d ^
5871008 ^
06bae9d ^
352cae4 ^
338c083 ^
352cae4 ^
bab575c ^
1549faf ^
7ab8c87 ^

1549faf ^
42fd392 ^


bab575c ^
df74b26 ^
7ab8c87 ^

df74b26 ^
45aea23 ^
7ab8c87 ^
45aea23 ^
df74b26 ^
338c083 ^
1549faf ^
8dc8605 ^
338c083 ^
8dc8605 ^
bab575c ^
df74b26 ^
7ab8c87 ^

1549faf ^
bab575c ^
7ab8c87 ^
daae3bb ^
bab575c ^
3e06ede ^
7ab8c87 ^

4bb89e2 ^
df74b26 ^
7ab8c87 ^
2b35fae ^
0c3544d ^
0e5c819 ^
338c083 ^
0e5c819 ^
4bd0d33 ^
5871008 ^
4bd0d33 ^
0e5c819 ^
338c083 ^
0c3544d ^
7ab8c87 ^
dc5c070 ^
7e98db2 ^

bced907 ^
60b3dce ^
21bd90d ^
c8f96b5 ^
4bb89e2 ^
c8f96b5 ^



c7da124 ^


c8f96b5 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148