all repos — fluxbox @ f0a178f515a4d207288875fcff55dbd073b6319b

custom fork of the fluxbox windowmanager

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
commit

f0a178f515a4d207288875fcff55dbd073b6319b

parent

026343b6b13024c56e9273f5012076536965bd27

1 files changed, 3 insertions(+), 8 deletions(-)

jump to
M src/Xutil.ccsrc/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;