diff options
| author | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-19 10:40:07 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-19 10:40:07 +0200 |
| commit | 96d7fe16eaf6b656800f08da3156bacd75ca3b08 (patch) | |
| tree | 98d884e096b5108d8181914540718b6b82c6893e /client.c | |
| parent | small fix (diff) | |
| download | dwm-96d7fe16eaf6b656800f08da3156bacd75ca3b08.tar.gz dwm-96d7fe16eaf6b656800f08da3156bacd75ca3b08.zip | |
prepared merging layout.c and tag.c into screen.c
Diffstat (limited to '')
| -rw-r--r-- | client.c | 36 |
1 files changed, 4 insertions, 32 deletions
| @@ -185,15 +185,8 @@ Bool | |||
| 185 | loadprops(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 | |
| 189 | 189 | if(gettextprop(c->win, dwmprops, prop, sizeof prop)) { | |
| 190 | /* check if window has set a property */ | ||
| 191 | name.nitems = 0; | ||
| 192 | XGetTextProperty(dpy, c->win, &name, dwmprops); | ||
| 193 | if(name.nitems && name.encoding == XA_STRING) { | ||
| 194 | strncpy(prop, (char *)name.value, sizeof prop - 1); | ||
| 195 | prop[sizeof prop - 1] = '\0'; | ||
| 196 | XFree(name.value); | ||
| 197 | for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++) | 190 | for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++) |
| 198 | if((c->tags[i] = prop[i] == '1')) | 191 | if((c->tags[i] = prop[i] == '1')) |
| 199 | result = True; | 192 | result = True; |
| @@ -424,27 +417,6 @@ updatesizehints(Client *c) { | |||
| 424 | 417 | ||
| 425 | void | 418 | void |
| 426 | updatetitle(Client *c) { | 419 | updatetitle(Client *c) { |
| 427 | char **list = NULL; | 420 | if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) |
| 428 | int n; | 421 | gettextprop(c->win, wmatom[WMName], c->name, sizeof c->name); |
| 429 | XTextProperty name; | ||
| 430 | |||
| 431 | name.nitems = 0; | ||
| 432 | c->name[0] = 0; | ||
| 433 | XGetTextProperty(dpy, c->win, &name, netatom[NetWMName]); | ||
| 434 | if(!name.nitems) | ||
| 435 | XGetWMName(dpy, c->win, &name); | ||
| 436 | if(!name.nitems) | ||
| 437 | return; | ||
| 438 | if(name.encoding == XA_STRING) | ||
| 439 | strncpy(c->name, (char *)name.value, sizeof c->name - 1); | ||
| 440 | else { | ||
| 441 | if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success | ||
| 442 | && n > 0 && *list) | ||
| 443 | { | ||
| 444 | strncpy(c->name, *list, sizeof c->name - 1); | ||
| 445 | XFreeStringList(list); | ||
| 446 | } | ||
| 447 | } | ||
| 448 | c->name[sizeof c->name - 1] = '\0'; | ||
| 449 | XFree(name.value); | ||
| 450 | } | 422 | } |
