summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/client.c b/client.c
index d11ef7f..d94c0ed 100644
--- a/client.c
+++ b/client.c
@@ -185,15 +185,8 @@ Bool
185loadprops(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
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
425void 418void
426updatetitle(Client *c) { 419updatetitle(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}