Merge pull request #2148 from eulertour/master

UI: Fall back to XGetWMName if XFetchName fails
This commit is contained in:
Jim
2019-11-05 12:54:50 -08:00
committed by GitHub

View File

@@ -126,10 +126,17 @@ static std::string GetWindowTitle(size_t i)
if (status >= Success && name != nullptr) {
std::string str(name);
windowTitle = str;
XFree(name);
} else {
XTextProperty xtp_new_name;
if (XGetWMName(disp(), w, &xtp_new_name) != 0 &&
xtp_new_name.value != nullptr) {
std::string str((const char *)xtp_new_name.value);
windowTitle = str;
XFree(xtp_new_name.value);
}
}
XFree(name);
return windowTitle;
}