aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-06-12 15:13:23 (GMT)
committerrathnor <rathnor>2003-06-12 15:13:23 (GMT)
commitc314d05553b6105b983267a97d14429681d90ae2 (patch)
tree835ddfee957a6cc1a939a8dfd4cc2be4ea282263 /src/WinClient.cc
parente139cbb0283f7480fc26c58dc3f8a48e69011eab (diff)
downloadfluxbox-c314d05553b6105b983267a97d14429681d90ae2.zip
fluxbox-c314d05553b6105b983267a97d14429681d90ae2.tar.bz2
add some property accessors
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r--src/WinClient.cc47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index 1349b1e..f44edc3 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.10 2003/06/12 14:51:59 fluxgen Exp $ 22// $Id: WinClient.cc,v 1.11 2003/06/12 15:13:23 rathnor Exp $
23 23
24#include "WinClient.hh" 24#include "WinClient.hh"
25 25
@@ -176,6 +176,51 @@ 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 {
180 XClassHint ch;
181
182 if (XGetClassHint(FbTk::App::instance()->display(), window(), &ch) == 0) {
183#ifdef DEBUG
184 cerr<<"Failed to read class hint!"<<endl;
185#endif //DEBUG
186 return "";
187 } else {
188 string m_instance_name;
189 if (ch.res_name != 0) {
190 m_instance_name = const_cast<char *>(ch.res_name);
191 XFree(ch.res_name);
192 } else
193 m_instance_name = "";
194
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) {
216 m_class_name = const_cast<char *>(ch.res_class);
217 XFree(ch.res_class);
218 } else
219 m_class_name = "";
220 return m_class_name;
221 }
222}
223
179void WinClient::updateTransientInfo() { 224void WinClient::updateTransientInfo() {
180 if (m_win == 0) 225 if (m_win == 0)
181 return; 226 return;