diff options
-rw-r--r-- | src/Xutil.cc | 11 |
1 files 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) { | |||
97 | 97 | ||
98 | if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { | 98 | if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { |
99 | fbdbg<<"Xutil: Failed to read class hint!"<<endl; | 99 | fbdbg<<"Xutil: Failed to read class hint!"<<endl; |
100 | |||
101 | instance_name = ""; | ||
102 | } else { | 100 | } else { |
103 | 101 | ||
104 | XFree(ch.res_class); | 102 | XFree(ch.res_class); |
105 | 103 | ||
106 | if (ch.res_class != 0) { | 104 | if (ch.res_name != 0) { |
107 | instance_name = const_cast<char *>(ch.res_name); | 105 | instance_name = const_cast<char *>(ch.res_name); |
108 | XFree(ch.res_name); | 106 | XFree(ch.res_name); |
109 | ch.res_name = 0; | 107 | ch.res_name = 0; |
110 | } else | 108 | } |
111 | instance_name = ""; | ||
112 | } | 109 | } |
113 | 110 | ||
114 | return instance_name; | 111 | return instance_name; |
@@ -122,7 +119,6 @@ FbTk::FbString getWMClassClass(Window win) { | |||
122 | 119 | ||
123 | if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { | 120 | if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { |
124 | fbdbg<<"Xutil: Failed to read class hint!"<<endl; | 121 | fbdbg<<"Xutil: Failed to read class hint!"<<endl; |
125 | class_name = ""; | ||
126 | } else { | 122 | } else { |
127 | 123 | ||
128 | XFree(ch.res_name); | 124 | XFree(ch.res_name); |
@@ -131,8 +127,7 @@ FbTk::FbString getWMClassClass(Window win) { | |||
131 | class_name = const_cast<char *>(ch.res_class); | 127 | class_name = const_cast<char *>(ch.res_class); |
132 | XFree(ch.res_class); | 128 | XFree(ch.res_class); |
133 | ch.res_class = 0; | 129 | ch.res_class = 0; |
134 | } else | 130 | } |
135 | class_name = ""; | ||
136 | } | 131 | } |
137 | 132 | ||
138 | return class_name; | 133 | return class_name; |