diff options
author | Henrik Kinnunen <fluxgen@fluxbox.org> | 2010-03-17 15:35:07 (GMT) |
---|---|---|
committer | Henrik Kinnunen <fluxgen@fluxbox.org> | 2010-03-17 15:35:07 (GMT) |
commit | ce0b41c8472135898a553d6d649d852beb80cffb (patch) | |
tree | 8cca2f6d8795c19c86ab70fa22e9c724e5f4453b /src/WinClient.cc | |
parent | 7a86dad21b1d50b35857496c165e4e85cc0d2bd3 (diff) | |
download | fluxbox-ce0b41c8472135898a553d6d649d852beb80cffb.zip fluxbox-ce0b41c8472135898a553d6d649d852beb80cffb.tar.bz2 |
Changed #ifdef DEBUG ... cerr << to using fbdbg.
This will reduce the number of #ifdef DEBUG for
simple debug messages.
include "Debug.hh" and use fbdbg instead of cerr for debug.
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r-- | src/WinClient.cc | 42 |
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 @@ | |||
52 | using std::string; | 52 | using std::string; |
53 | using std::list; | 53 | using std::list; |
54 | using std::mem_fun; | 54 | using std::mem_fun; |
55 | |||
56 | #ifdef DEBUG | ||
57 | using std::cerr; | ||
58 | using std::endl; | 55 | using std::endl; |
56 | using std::cerr; | ||
59 | using std::hex; | 57 | using std::hex; |
60 | using std::dec; | 58 | using std::dec; |
61 | #endif // DEBUG | 59 | |
62 | 60 | ||
63 | WinClient::TransientWaitMap WinClient::s_transient_wait; | 61 | WinClient::TransientWaitMap WinClient::s_transient_wait; |
64 | 62 | ||
@@ -110,9 +108,7 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin): | |||
110 | } | 108 | } |
111 | 109 | ||
112 | WinClient::~WinClient() { | 110 | WinClient::~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 { | |||
241 | void WinClient::updateWMClassHint() { | 236 | void 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 | } |