aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2010-03-17 15:35:07 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2010-03-17 15:35:07 (GMT)
commitce0b41c8472135898a553d6d649d852beb80cffb (patch)
tree8cca2f6d8795c19c86ab70fa22e9c724e5f4453b /src/fluxbox.cc
parent7a86dad21b1d50b35857496c165e4e85cc0d2bd3 (diff)
downloadfluxbox-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/fluxbox.cc')
-rw-r--r--src/fluxbox.cc38
1 files changed, 14 insertions, 24 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 108e400..a443504 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -36,6 +36,7 @@
36#include "Layer.hh" 36#include "Layer.hh"
37 37
38#include "defaults.hh" 38#include "defaults.hh"
39#include "Debug.hh"
39 40
40#include "FbTk/I18n.hh" 41#include "FbTk/I18n.hh"
41#include "FbTk/Image.hh" 42#include "FbTk/Image.hh"
@@ -141,11 +142,8 @@ using std::pair;
141using std::bind2nd; 142using std::bind2nd;
142using std::mem_fun; 143using std::mem_fun;
143using std::equal_to; 144using std::equal_to;
144
145#ifdef DEBUG
146using std::hex; 145using std::hex;
147using std::dec; 146using std::dec;
148#endif // DEBUG
149 147
150using namespace FbTk; 148using namespace FbTk;
151 149
@@ -407,10 +405,10 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name,
407 m_resourcemanager.unlock(); 405 m_resourcemanager.unlock();
408 ungrab(); 406 ungrab();
409 407
410#ifdef DEBUG 408 if (m_resourcemanager.lockDepth() != 0) {
411 if (m_resourcemanager.lockDepth() != 0) 409 fbdbg<<"--- resource manager lockdepth = "<<m_resourcemanager.lockDepth()<<endl;
412 cerr<<"--- resource manager lockdepth = "<<m_resourcemanager.lockDepth()<<endl; 410 }
413#endif //DEBUG 411
414 m_starting = false; 412 m_starting = false;
415 // 413 //
416 // For dumping theme items 414 // For dumping theme items
@@ -494,10 +492,8 @@ void Fluxbox::eventLoop() {
494 e.type != DestroyNotify) { // we must let the actual destroys through 492 e.type != DestroyNotify) { // we must let the actual destroys through
495 if (e.type == FocusOut) 493 if (e.type == FocusOut)
496 revertFocus(); 494 revertFocus();
497#ifdef DEBUG
498 else 495 else
499 cerr<<"Fluxbox::eventLoop(): removing bad window from event queue"<<endl; 496 fbdbg<<"Fluxbox::eventLoop(): removing bad window from event queue"<<endl;
500#endif // DEBUG
501 } else { 497 } else {
502 last_bad_window = None; 498 last_bad_window = None;
503 handleEvent(&e); 499 handleEvent(&e);
@@ -568,9 +564,7 @@ void Fluxbox::setupConfigFiles() {
568 create_windowmenu = true; 564 create_windowmenu = true;
569 565
570 } else { 566 } else {
571#ifdef DEBUG 567 fbdbg<<"Creating dir: " << dirname.c_str() << endl;
572 cerr <<__FILE__<<"("<<__LINE__<<"): Creating dir: " << dirname.c_str() << endl;
573#endif // DEBUG
574 _FB_USES_NLS; 568 _FB_USES_NLS;
575 // create directory with perm 700 569 // create directory with perm 700
576 if (mkdir(dirname.c_str(), 0700)) { 570 if (mkdir(dirname.c_str(), 0700)) {
@@ -715,10 +709,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
715 break; 709 break;
716 case MapRequest: { 710 case MapRequest: {
717 711
718#ifdef DEBUG 712 fbdbg<<"MapRequest for 0x"<<hex<<e->xmaprequest.window<<dec<<endl;
719 cerr<<"MapRequest for 0x"<<hex<<e->xmaprequest.window<<dec<<endl;
720
721#endif // DEBUG
722 713
723 WinClient *winclient = searchWindow(e->xmaprequest.window); 714 WinClient *winclient = searchWindow(e->xmaprequest.window);
724 715
@@ -764,9 +755,8 @@ void Fluxbox::handleEvent(XEvent * const e) {
764 break; 755 break;
765 case MappingNotify: 756 case MappingNotify:
766 // Update stored modifier mapping 757 // Update stored modifier mapping
767#ifdef DEBUG 758 fbdbg<<"MappingNotify"<<endl;
768 cerr<<__FILE__<<"("<<__FUNCTION__<<"): MappingNotify"<<endl; 759
769#endif // DEBUG
770 if (e->xmapping.request == MappingKeyboard 760 if (e->xmapping.request == MappingKeyboard
771 || e->xmapping.request == MappingModifier) { 761 || e->xmapping.request == MappingModifier) {
772 XRefreshKeyboardMapping(&e->xmapping); 762 XRefreshKeyboardMapping(&e->xmapping);
@@ -942,7 +932,7 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) {
942 if (ce.message_type) 932 if (ce.message_type)
943 atom = XGetAtomName(FbTk::App::instance()->display(), ce.message_type); 933 atom = XGetAtomName(FbTk::App::instance()->display(), ce.message_type);
944 934
945 cerr<<__FILE__<<"("<<__LINE__<<"): ClientMessage. data.l[0]=0x"<<hex<<ce.data.l[0]<< 935 fbdbg<<__FILE__<<"("<<__LINE__<<"): ClientMessage. data.l[0]=0x"<<hex<<ce.data.l[0]<<
946 " message_type=0x"<<ce.message_type<<dec<<" = \""<<atom<<"\""<<endl; 936 " message_type=0x"<<ce.message_type<<dec<<" = \""<<atom<<"\""<<endl;
947 937
948 if (ce.message_type && atom) XFree((char *) atom); 938 if (ce.message_type && atom) XFree((char *) atom);
@@ -1295,9 +1285,9 @@ void Fluxbox::save_rc() {
1295 XrmMergeDatabases(new_blackboxrc, &old_blackboxrc); //merge database together 1285 XrmMergeDatabases(new_blackboxrc, &old_blackboxrc); //merge database together
1296 XrmPutFileDatabase(old_blackboxrc, dbfile.c_str()); 1286 XrmPutFileDatabase(old_blackboxrc, dbfile.c_str());
1297 XrmDestroyDatabase(old_blackboxrc); 1287 XrmDestroyDatabase(old_blackboxrc);
1298#ifdef DEBUG 1288
1299 cerr<<__FILE__<<"("<<__LINE__<<"): ------------ SAVING DONE"<<endl; 1289 fbdbg<<__FILE__<<"("<<__LINE__<<"): ------------ SAVING DONE"<<endl;
1300#endif // DEBUG 1290
1301} 1291}
1302 1292
1303/// @return filename of resource file 1293/// @return filename of resource file