Merge pull request #2148 from eulertour/master
UI: Fall back to XGetWMName if XFetchName failsmaster
commit
cbfb779876
|
@ -126,10 +126,17 @@ static std::string GetWindowTitle(size_t i)
|
||||||
if (status >= Success && name != nullptr) {
|
if (status >= Success && name != nullptr) {
|
||||||
std::string str(name);
|
std::string str(name);
|
||||||
windowTitle = str;
|
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;
|
return windowTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue