summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-08-18 14:20:56 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-08-18 14:20:56 +0200
commit0c6062041035105c6266f6bedb286c1990516fa7 (patch)
tree0333fb545f61fa6a409e8fd9d1167ee2f9b25428 /client.c
parentcleaned up settags-handling (diff)
downloaddwm-0c6062041035105c6266f6bedb286c1990516fa7.tar.gz
dwm-0c6062041035105c6266f6bedb286c1990516fa7.zip
hmm I doubt the usefulness of storing this information...
Diffstat (limited to '')
-rw-r--r--client.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/client.c b/client.c
index 882b8ee..d11ef7f 100644
--- a/client.c
+++ b/client.c
@@ -7,7 +7,7 @@
7 7
8/* static */ 8/* static */
9 9
10static char config[128]; 10static char prop[128];
11 11
12static void 12static void
13attachstack(Client *c) { 13attachstack(Client *c) {
@@ -182,23 +182,23 @@ killclient(const char *arg) {
182} 182}
183 183
184Bool 184Bool
185loadconfig(Client *c) { 185loadprops(Client *c) {
186 unsigned int i; 186 unsigned int i;
187 Bool result = False; 187 Bool result = False;
188 XTextProperty name; 188 XTextProperty name;
189 189
190 /* check if window has set a property */ 190 /* check if window has set a property */
191 name.nitems = 0; 191 name.nitems = 0;
192 XGetTextProperty(dpy, c->win, &name, dwmconfig); 192 XGetTextProperty(dpy, c->win, &name, dwmprops);
193 if(name.nitems && name.encoding == XA_STRING) { 193 if(name.nitems && name.encoding == XA_STRING) {
194 strncpy(config, (char *)name.value, sizeof config - 1); 194 strncpy(prop, (char *)name.value, sizeof prop - 1);
195 config[sizeof config - 1] = '\0'; 195 prop[sizeof prop - 1] = '\0';
196 XFree(name.value); 196 XFree(name.value);
197 for(i = 0; i < ntags && i < sizeof config - 1 && config[i] != '\0'; i++) 197 for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++)
198 if((c->tags[i] = config[i] == '1')) 198 if((c->tags[i] = prop[i] == '1'))
199 result = True; 199 result = True;
200 if(i < sizeof config - 1 && config[i] != '\0') 200 if(i < sizeof prop - 1 && prop[i] != '\0')
201 c->isfloating = config[i] == '1'; 201 c->isfloating = prop[i] == '1';
202 } 202 }
203 return result; 203 return result;
204} 204}
@@ -249,11 +249,11 @@ manage(Window w, XWindowAttributes *wa) {
249 if(t) 249 if(t)
250 for(i = 0; i < ntags; i++) 250 for(i = 0; i < ntags; i++)
251 c->tags[i] = t->tags[i]; 251 c->tags[i] = t->tags[i];
252 if(!loadconfig(c)) 252 if(!loadprops(c))
253 applyrules(c); 253 applyrules(c);
254 if(!c->isfloating) 254 if(!c->isfloating)
255 c->isfloating = (rettrans == Success) || c->isfixed; 255 c->isfloating = (rettrans == Success) || c->isfixed;
256 saveconfig(c); 256 saveprops(c);
257 attach(c); 257 attach(c);
258 attachstack(c); 258 attachstack(c);
259 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */ 259 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
@@ -325,16 +325,16 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
325} 325}
326 326
327void 327void
328saveconfig(Client *c) { 328saveprops(Client *c) {
329 unsigned int i; 329 unsigned int i;
330 330
331 for(i = 0; i < ntags && i < sizeof config - 1; i++) 331 for(i = 0; i < ntags && i < sizeof prop - 1; i++)
332 config[i] = c->tags[i] ? '1' : '0'; 332 prop[i] = c->tags[i] ? '1' : '0';
333 if(i < sizeof config - 1) 333 if(i < sizeof prop - 1)
334 config[i++] = c->isfloating ? '1' : '0'; 334 prop[i++] = c->isfloating ? '1' : '0';
335 config[i] = '\0'; 335 prop[i] = '\0';
336 XChangeProperty(dpy, c->win, dwmconfig, XA_STRING, 8, 336 XChangeProperty(dpy, c->win, dwmprops, XA_STRING, 8,
337 PropModeReplace, (unsigned char *)config, i); 337 PropModeReplace, (unsigned char *)prop, i);
338} 338}
339 339
340void 340void