+ xch = NULL;
+ if ((title_name_enabled == 1 || title_class_enabled == 1) &&
+ cur_focus != NULL) {
+ if ((xch = XAllocClassHint()) == NULL)
+ goto out;
+ status = XGetClassHint(display, cur_focus->id, xch);
+ if (status == BadWindow || status == BadAlloc)
+ goto out;
+ if (title_name_enabled)
+ strlcat(s, xch->res_name, sizeof s);
+ if (title_name_enabled && title_class_enabled)
+ strlcat(s, " ", sizeof s);
+ if (title_class_enabled)
+ strlcat(s, xch->res_class, sizeof s);
+ }
+out:
+ if (xch)
+ XFree(xch);