From f0a178f515a4d207288875fcff55dbd073b6319b Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sun, 14 Sep 2014 17:52:29 +0200 Subject: 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. --- src/Xutil.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Xutil.cc b/src/Xutil.cc index 2ef9315..68432a3 100644 --- a/src/Xutil.cc +++ b/src/Xutil.cc @@ -97,18 +97,15 @@ FbTk::FbString getWMClassName(Window win) { if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { fbdbg<<"Xutil: Failed to read class hint!"<(ch.res_name); XFree(ch.res_name); ch.res_name = 0; - } else - instance_name = ""; + } } return instance_name; @@ -122,7 +119,6 @@ FbTk::FbString getWMClassClass(Window win) { if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { fbdbg<<"Xutil: Failed to read class hint!"<(ch.res_class); XFree(ch.res_class); ch.res_class = 0; - } else - class_name = ""; + } } return class_name; -- cgit v0.11.2