summaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r--src/WinClient.cc42
1 files changed, 16 insertions, 26 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index 3a22e4a..0787382 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -26,8 +26,8 @@
26#include "FocusControl.hh" 26#include "FocusControl.hh"
27#include "Screen.hh" 27#include "Screen.hh"
28#include "FbAtoms.hh" 28#include "FbAtoms.hh"
29
30#include "Xutil.hh" 29#include "Xutil.hh"
30#include "Debug.hh"
31 31
32#include "FbTk/EventManager.hh" 32#include "FbTk/EventManager.hh"
33#include "FbTk/MultLayers.hh" 33#include "FbTk/MultLayers.hh"
@@ -52,13 +52,11 @@
52using std::string; 52using std::string;
53using std::list; 53using std::list;
54using std::mem_fun; 54using std::mem_fun;
55
56#ifdef DEBUG
57using std::cerr;
58using std::endl; 55using std::endl;
56using std::cerr;
59using std::hex; 57using std::hex;
60using std::dec; 58using std::dec;
61#endif // DEBUG 59
62 60
63WinClient::TransientWaitMap WinClient::s_transient_wait; 61WinClient::TransientWaitMap WinClient::s_transient_wait;
64 62
@@ -110,9 +108,7 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):
110} 108}
111 109
112WinClient::~WinClient() { 110WinClient::~WinClient() {
113#ifdef DEBUG 111 fbdbg<<__FILE__<<"(~"<<__FUNCTION__<<")[this="<<this<<"]"<<endl;
114 cerr<<__FILE__<<"(~"<<__FUNCTION__<<")[this="<<this<<"]"<<endl;
115#endif // DEBUG
116 112
117 FbTk::EventManager::instance()->remove(window()); 113 FbTk::EventManager::instance()->remove(window());
118 114
@@ -175,10 +171,9 @@ bool WinClient::sendFocus() {
175 } 171 }
176 if (!send_focus_message) 172 if (!send_focus_message)
177 return false; 173 return false;
178#ifdef DEBUG 174
179 cerr<<"WinClient::"<<__FUNCTION__<<": this = "<<this<< 175 fbdbg<<"WinClient::"<<__FUNCTION__<<": this = "<<this<<
180 " window = 0x"<<hex<<window()<<dec<<endl; 176 " window = 0x"<<hex<<window()<<dec<<endl;
181#endif // DEBUG
182 177
183 // setup focus msg 178 // setup focus msg
184 XEvent ce; 179 XEvent ce;
@@ -241,9 +236,9 @@ string WinClient::getWMRole() const {
241void WinClient::updateWMClassHint() { 236void WinClient::updateWMClassHint() {
242 XClassHint ch; 237 XClassHint ch;
243 if (XGetClassHint(display(), window(), &ch) == 0) { 238 if (XGetClassHint(display(), window(), &ch) == 0) {
244#ifdef DEBUG 239
245 cerr<<"WinClient: Failed to read class hint!"<<endl; 240 fbdbg<<"WinClient: Failed to read class hint!"<<endl;
246#endif //DEBUG 241
247 m_instance_name = m_class_name = ""; 242 m_instance_name = m_class_name = "";
248 } else { 243 } else {
249 244
@@ -275,17 +270,14 @@ void WinClient::updateTransientInfo() {
275 // determine if this is a transient window 270 // determine if this is a transient window
276 Window win = 0; 271 Window win = 0;
277 if (!XGetTransientForHint(display(), window(), &win)) { 272 if (!XGetTransientForHint(display(), window(), &win)) {
278#ifdef DEBUG 273
279 cerr<<__FUNCTION__<<": window() = 0x"<<hex<<window()<<dec<<"Failed to read transient for hint."<<endl; 274 fbdbg<<__FUNCTION__<<": window() = 0x"<<hex<<window()<<dec<<"Failed to read transient for hint."<<endl;
280#endif // DEBUG
281 return; 275 return;
282 } 276 }
283 277
284 // we can't be transient to ourself 278 // we can't be transient to ourself
285 if (win == window()) { 279 if (win == window()) {
286#ifdef DEBUG
287 cerr<<__FUNCTION__<<": transient to ourself"<<endl; 280 cerr<<__FUNCTION__<<": transient to ourself"<<endl;
288#endif // DEBUG
289 return; 281 return;
290 } 282 }
291 283
@@ -314,10 +306,9 @@ void WinClient::updateTransientInfo() {
314 } 306 }
315 307
316 308
317#ifdef DEBUG 309 fbdbg<<__FUNCTION__<<": transient_for window = 0x"<<hex<<win<<dec<<endl;
318 cerr<<__FUNCTION__<<": transient_for window = 0x"<<hex<<win<<dec<<endl; 310 fbdbg<<__FUNCTION__<<": transient_for = "<<transient_for<<endl;
319 cerr<<__FUNCTION__<<": transient_for = "<<transient_for<<endl; 311
320#endif // DEBUG
321 // make sure we don't have deadlock loop in transient chain 312 // make sure we don't have deadlock loop in transient chain
322 for (WinClient *w = this; w != 0; w = w->transient_for) { 313 for (WinClient *w = this; w != 0; w = w->transient_for) {
323 if (this == w->transient_for) 314 if (this == w->transient_for)
@@ -604,10 +595,9 @@ void WinClient::updateWMProtocols() {
604 XFree(proto); 595 XFree(proto);
605 if (fbwindow()) 596 if (fbwindow())
606 fbwindow()->updateFunctions(); 597 fbwindow()->updateFunctions();
607#ifdef DEBUG 598
608 } else { 599 } else {
609 cerr<<"Warning: Failed to read WM Protocols. "<<endl; 600 fbdbg<<"Warning: Failed to read WM Protocols. "<<endl;
610#endif // DEBUG
611 } 601 }
612 602
613} 603}