Xinqi Bao's Git
0861128f594a7a08bd7ec4238d31893cab95e08b
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
10 #include <X11/Xutil.h>
14 static Rule rule
[] = {
15 /* class instance tags dofloat */
16 { "Firefox-bin", "Gecko", { [Twww
] = "www" }, False
},
19 void (*arrange
)(Arg
*) = dotile
;
24 for(; c
&& !c
->tags
[tsel
]; c
= c
->next
);
32 static unsigned int len
= rule
? sizeof(rule
) / sizeof(rule
[0]) : 0;
37 c
->tags
[tsel
] = tags
[tsel
];
41 if(XGetClassHint(dpy
, c
->win
, &ch
)) {
42 if(ch
.res_class
&& ch
.res_name
) {
43 for(i
= 0; i
< len
; i
++)
44 if(!strncmp(rule
[i
].class, ch
.res_class
, sizeof(rule
[i
].class))
45 && !strncmp(rule
[i
].instance
, ch
.res_name
, sizeof(rule
[i
].instance
)))
47 for(j
= 0; j
< TLast
; j
++)
48 c
->tags
[j
] = rule
[i
].tags
[j
];
49 c
->dofloat
= rule
[i
].dofloat
;
61 c
->tags
[tsel
] = tags
[tsel
];
78 for(c
= clients
; c
; c
= c
->next
) {
84 if(sel
&& !sel
->tags
[tsel
]) {
85 if((sel
= getnext(clients
))) {
101 for(n
= 0, c
= clients
; c
; c
= c
->next
)
102 if(c
->tags
[tsel
] && !c
->dofloat
)
106 h
= (sh
- bh
) / (n
- 1);
110 for(i
= 0, c
= clients
; c
; c
= c
->next
) {
120 c
->w
= sw
- 2 * c
->border
;
121 c
->h
= sh
- 2 * c
->border
- bh
;
126 c
->w
= mw
- 2 * c
->border
;
127 c
->h
= sh
- 2 * c
->border
- bh
;
131 c
->y
= sy
+ (i
- 1) * h
+ bh
;
132 c
->w
= w
- 2 * c
->border
;
133 c
->h
= h
- 2 * c
->border
;
141 if(!sel
|| (sel
&& !sel
->tags
[tsel
])) {
142 if((sel
= getnext(clients
))) {
156 sel
->tags
[arg
->i
] = tags
[arg
->i
];
167 for(i
= 0; i
< TLast
; i
++)