- status = XGetWindowProperty(dpy, win, a_netwmname, 0L, 0L, False,
- a_utf8_string, &rettype, &retfmt, &nitems, &nbytes, &prop);
- if (status != Success)
- return (NULL);
- XFree(prop);
-
- status = XGetWindowProperty(dpy, win, a_netwmname, 0L, nbytes, False,
- a_utf8_string, &rettype, &retfmt, &nitems, &nextra, &prop);
- if (status != Success) {
+ /* try _NET_WM_NAME first */
+ if (get_property(win, a_netwmname, 0L, a_utf8_string, NULL, &nbytes,
+ &prop)) {