fix: check the correct XClassHint property kudos to Arkadiusz Bokowy (this commit is a slightly changed version of a patch sent to the devel-ml): when retrieving the '.res_name' of a XClassHint we should check '.res_name' and not '.res_class'. the other changes only reduce the code.
Mathias Gumz akira at fluxbox dot org
1 files changed,
3 insertions(+),
8 deletions(-)
jump to
M
src/Xutil.cc
→
src/Xutil.cc
@@ -97,18 +97,15 @@ FbTk::FbString instance_name;
if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { fbdbg<<"Xutil: Failed to read class hint!"<<endl; - - instance_name = ""; } else { XFree(ch.res_class); - if (ch.res_class != 0) { + if (ch.res_name != 0) { instance_name = const_cast<char *>(ch.res_name); XFree(ch.res_name); ch.res_name = 0; - } else - instance_name = ""; + } } return instance_name;@@ -122,7 +119,6 @@ FbTk::FbString class_name;
if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { fbdbg<<"Xutil: Failed to read class hint!"<<endl; - class_name = ""; } else { XFree(ch.res_name);@@ -131,8 +127,7 @@ if (ch.res_class != 0) {
class_name = const_cast<char *>(ch.res_class); XFree(ch.res_class); ch.res_class = 0; - } else - class_name = ""; + } } return class_name;