1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-25 13:55:47 -05:00

fix(xrm): res_class==nullptr to properly get the resource (#368)

Not sure what "String" was supposed to do, my tests with xcb-xrm gives that
res_class==nullptr properly gets the resource value, =="String" does not.
This commit is contained in:
Daniel Lublin 2017-01-23 17:54:20 +01:00 committed by Michael Carlberg
parent 1fdc742606
commit b6661825ce

View file

@ -36,7 +36,7 @@ class xresource_manager {
template <typename T> template <typename T>
T require(const char* name) const { T require(const char* name) const {
char* result{nullptr}; char* result{nullptr};
if (xcb_xrm_resource_get_string(m_xrm, string_util::replace(name, "*", ".").c_str(), "String", &result) == -1) { if (xcb_xrm_resource_get_string(m_xrm, string_util::replace(name, "*", ".").c_str(), nullptr, &result) == -1) {
throw xresource_error(sstream() << "X resource \"" << name << "\" not found"); throw xresource_error(sstream() << "X resource \"" << name << "\" not found");
} else if (result == nullptr) { } else if (result == nullptr) {
throw xresource_error(sstream() << "X resource \"" << name << "\" not found"); throw xresource_error(sstream() << "X resource \"" << name << "\" not found");