diff options
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 38 |
1 files changed, 19 insertions, 19 deletions
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | /* static */ | 8 | /* static */ |
| 9 | 9 | ||
| 10 | static char config[128]; | 10 | static char prop[128]; |
| 11 | 11 | ||
| 12 | static void | 12 | static void |
| 13 | attachstack(Client *c) { | 13 | attachstack(Client *c) { |
| @@ -182,23 +182,23 @@ killclient(const char *arg) { | |||
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | Bool | 184 | Bool |
| 185 | loadconfig(Client *c) { | 185 | loadprops(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 | ||
| 327 | void | 327 | void |
| 328 | saveconfig(Client *c) { | 328 | saveprops(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 | ||
| 340 | void | 340 | void |
