aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/WinClient.cc43
1 files changed, 15 insertions, 28 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index f44edc3..ea29bc2 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: WinClient.cc,v 1.11 2003/06/12 15:13:23 rathnor Exp $ 22// $Id: WinClient.cc,v 1.12 2003/06/15 18:36:16 fluxgen Exp $
23 23
24#include "WinClient.hh" 24#include "WinClient.hh"
25 25
@@ -176,48 +176,35 @@ bool WinClient::getWMIconName(XTextProperty &textprop) const {
176 return XGetWMName(FbTk::App::instance()->display(), window(), &textprop); 176 return XGetWMName(FbTk::App::instance()->display(), window(), &textprop);
177} 177}
178 178
179const std::string WinClient::getWMClassName() const { 179const std::string &WinClient::getWMClassName() const {
180 return m_instance_name;
181}
182
183const std::string &WinClient::getWMClassClass() const {
184 return m_class_name;
185}
186
187void WinClient::updateWMClassHint() {
180 XClassHint ch; 188 XClassHint ch;
181
182 if (XGetClassHint(FbTk::App::instance()->display(), window(), &ch) == 0) { 189 if (XGetClassHint(FbTk::App::instance()->display(), window(), &ch) == 0) {
183#ifdef DEBUG 190#ifdef DEBUG
184 cerr<<"Failed to read class hint!"<<endl; 191 cerr<<"WinClient: Failed to read class hint!"<<endl;
185#endif //DEBUG 192#endif //DEBUG
186 return ""; 193 } else {
187 } else { 194
188 string m_instance_name;
189 if (ch.res_name != 0) { 195 if (ch.res_name != 0) {
190 m_instance_name = const_cast<char *>(ch.res_name); 196 m_instance_name = const_cast<char *>(ch.res_name);
191 XFree(ch.res_name); 197 XFree(ch.res_name);
198 ch.res_name = 0;
192 } else 199 } else
193 m_instance_name = ""; 200 m_instance_name = "";
194 201
195 if (ch.res_class != 0)
196 XFree(ch.res_class);
197
198 return m_instance_name;
199 }
200}
201
202const std::string WinClient::getWMClassClass() const {
203 XClassHint ch;
204
205 if (XGetClassHint(FbTk::App::instance()->display(), window(), &ch) == 0) {
206#ifdef DEBUG
207 cerr<<"Failed to read class hint!"<<endl;
208#endif //DEBUG
209 return "";
210 } else {
211 string m_class_name;
212 if (ch.res_name != 0)
213 XFree(ch.res_name);
214
215 if (ch.res_class != 0) { 202 if (ch.res_class != 0) {
216 m_class_name = const_cast<char *>(ch.res_class); 203 m_class_name = const_cast<char *>(ch.res_class);
217 XFree(ch.res_class); 204 XFree(ch.res_class);
205 ch.res_class = 0;
218 } else 206 } else
219 m_class_name = ""; 207 m_class_name = "";
220 return m_class_name;
221 } 208 }
222} 209}
223 210