all repos — fluxbox @ ce0b41c8472135898a553d6d649d852beb80cffb

custom fork of the fluxbox windowmanager

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.
Henrik Kinnunen fluxgen@fluxbox.org
commit

ce0b41c8472135898a553d6d649d852beb80cffb

parent

7a86dad21b1d50b35857496c165e4e85cc0d2bd3

A src/Debug.hh

@@ -0,0 +1,13 @@

+#ifndef DEBUG_HH +#define DEBUG_HH + +#include "config.h" +#include <iostream> + +#ifdef DEBUG +#define fbdbg std::cerr<<__FILE__<<"("<<__LINE__<< "): " +#else +#define fbdbg if (false) std::cerr +#endif // DEBUG + +#endif // DEBUG_HH
M src/Ewmh.ccsrc/Ewmh.cc

@@ -29,6 +29,7 @@ #include "Layer.hh"

#include "fluxbox.hh" #include "FbWinFrameTheme.hh" #include "FocusControl.hh" +#include "Debug.hh" #include "FbTk/App.hh" #include "FbTk/FbWindow.hh"

@@ -129,10 +130,10 @@ }

// actually there is some data in _NET_WM_ICON nr_icon_data = nr_bytes_left / sizeof(CARD32); -#ifdef DEBUG - std::cerr << "extractNetWmIcon: " << winclient.title() << "\n"; - std::cerr << "nr_icon_data: " << nr_icon_data << "\n"; -#endif + + fbdbg << "extractNetWmIcon: " << winclient.title() << "\n"; + fbdbg << "nr_icon_data: " << nr_icon_data << "\n"; + // read all the icons stored in _NET_WM_ICON if (raw_data) XFree(raw_data);

@@ -144,9 +145,9 @@ reinterpret_cast<unsigned char**>(&raw_data))) {

return; } -#ifdef DEBUG - std::cerr << "nr_read: " << nr_read << "|" << nr_bytes_left << "\n"; -#endif + + fbdbg << "nr_read: " << nr_read << "|" << nr_bytes_left << "\n"; + } IconContainer icon_data; // stores all available data, sorted by size (width x height)

@@ -161,28 +162,26 @@ for (i = 0; i + 2 < nr_icon_data; i += width * height ) {

width = raw_data[i++]; if (width >= nr_icon_data) { -#ifdef DEBUG - std::cerr << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON width (" + + fbdbg << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON width (" << width << ") for " << winclient.title() << "\n"; -#endif break; } height = raw_data[i++]; if (height >= nr_icon_data) { -#ifdef DEBUG - std::cerr << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON height (" + + fbdbg << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON height (" << height << ") for " << winclient.title() << "\n"; -#endif + break; } // strange values stored in the NETWM_ICON if (i + width * height > nr_icon_data) { -#ifdef DEBUG - std::cerr << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON dimensions (" + fbdbg << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON dimensions (" << width << "x" << height << ")for " << winclient.title() << "\n"; -#endif + break; }

@@ -1190,9 +1189,9 @@ winclient->fbwindow()->moveResizeForClient(x, y, width, height,

win_gravity, winclient->old_bw); return true; } else if (ce.message_type == m_net->restack_window) { -#ifndef DEBUG - cerr << "Ewmh: restack window" << endl; -#endif // DEBUG + + fbdbg << "Ewmh: restack window" << endl; + if (winclient == 0 || winclient->fbwindow() == 0) return true;
M src/FocusControl.ccsrc/FocusControl.cc

@@ -28,6 +28,7 @@ #include "WinClient.hh"

#include "Workspace.hh" #include "fluxbox.hh" #include "FbWinFrameTheme.hh" +#include "Debug.hh" #include "FbTk/EventManager.hh"

@@ -39,7 +40,6 @@ #else

#include <string.h> #endif -using std::cerr; using std::endl; using std::string;

@@ -551,14 +551,13 @@ BScreen *old_screen =

FocusControl::focusedWindow() ? &FocusControl::focusedWindow()->screen() : 0; -#ifdef DEBUG - cerr<<"------------------"<<endl; - cerr<<"Setting Focused window = "<<client<<endl; + fbdbg<<"------------------"<<endl; + fbdbg<<"Setting Focused window = "<<client<<endl; if (client != 0) - cerr<<"title: "<<client->title()<<endl; - cerr<<"Current Focused window = "<<s_focused_window<<endl; - cerr<<"------------------"<<endl; -#endif // DEBUG + fbdbg<<"title: "<<client->title()<<endl; + fbdbg<<"Current Focused window = "<<s_focused_window<<endl; + fbdbg<<"------------------"<<endl; + // Update the old focused client to non focus if (s_focused_fbwindow &&
M src/Gnome.ccsrc/Gnome.cc

@@ -28,6 +28,7 @@ #include "Screen.hh"

#include "WinClient.hh" #include "Workspace.hh" #include "Layer.hh" +#include "Debug.hh" #include <iostream> #ifdef HAVE_CSTRING

@@ -39,11 +40,8 @@

using std::cerr; using std::endl; using std::list; - -#ifdef DEBUG using std::hex; using std::dec; -#endif // DEBUG Gnome::Gnome() { createAtoms();

@@ -142,14 +140,10 @@

bool Gnome::propertyNotify(WinClient &winclient, Atom the_property) { if (the_property == m_gnome_wm_win_state) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): _WIN_STATE"<<endl; -#endif // DEBUG + fbdbg<<"("<<__FUNCTION__<<"): _WIN_STATE"<<endl; return true; } else if (the_property == m_gnome_wm_win_layer) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): _WIN_LAYER"<<endl; -#endif // DEBUG + fbdbg<<"("<<__FUNCTION__<<"): _WIN_LAYER"<<endl; return true; } return false;

@@ -268,10 +262,8 @@ long val = win.workspaceNumber();

if (win.isStuck()) { val = -1; } -#ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): setting workspace("<<val<< - ") for window("<<&win<<")"<<endl; -#endif // DEBUG + + fbdbg<<"setting workspace("<<val<<") for window("<<&win<<")"<<endl; FluxboxWindow::ClientList::iterator client_it = win.clientList().begin(); FluxboxWindow::ClientList::iterator client_it_end = win.clientList().end();

@@ -321,9 +313,9 @@ }

bool Gnome::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, WinClient * const winclient) { if (ce.message_type == m_gnome_wm_win_workspace) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): Got workspace atom="<<ce.data.l[0]<<endl; -#endif//!DEBUG + + fbdbg<<"Got workspace atom="<<ce.data.l[0]<<endl; + if ( winclient !=0 && // the message sent to client window? ce.data.l[0] >= 0 && ce.data.l[0] < (signed)winclient->screen().numberOfWorkspaces()) {

@@ -339,12 +331,12 @@ return false;

if (ce.message_type == m_gnome_wm_win_state) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_STATE"<<endl; - cerr<<__FILE__<<"("<<__LINE__<<"): Mask of members to change:"<< + + fbdbg<<"_WIN_STATE"<<endl; + fbdbg<<"Mask of members to change:"<< hex<<ce.data.l[0]<<dec<<endl; // mask_of_members_to_change - cerr<<"New members:"<<ce.data.l[1]<<endl; -#endif // DEBUG + fbdbg<<"New members:"<<ce.data.l[1]<<endl; + if (winclient && winclient->fbwindow()) { //get new states

@@ -357,15 +349,9 @@ // enable update of atom states

enableUpdate(); } } else if (ce.message_type == m_gnome_wm_win_hints) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_HINTS"<<endl; -#endif // DEBUG - + fbdbg<<"_WIN_HINTS"<<endl; } else if (ce.message_type == m_gnome_wm_win_layer) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): _WIN_LAYER"<<endl; -#endif // DEBUG - + fbdbg<<"_WIN_LAYER"<<endl; if (winclient && winclient->fbwindow()) setLayer(winclient->fbwindow(), ce.data.l[0]); } else

@@ -375,32 +361,29 @@ return true; // we handled the atom

} void Gnome::setState(FluxboxWindow *win, int state) { -#ifdef DEBUG - cerr<<"Gnome: state=0x"<<hex<<state<<dec<<endl; -#endif // DEBUG + fbdbg<<"Gnome: state=0x"<<hex<<state<<dec<<endl; if (state & WIN_STATE_STICKY) { -#ifdef DEBUG - cerr<<"Gnome state: Sticky"<<endl; -#endif // DEBUG + + fbdbg<<"Gnome state: Sticky"<<endl; + if (!win->isStuck()) win->stick(); } else if (win->isStuck()) win->stick(); if (state & WIN_STATE_MINIMIZED) { -#ifdef DEBUG - cerr<<"Gnome state: Minimized"<<endl; -#endif // DEBUG + fbdbg<<"Gnome state: Minimized"<<endl; + if (win->isIconic()) win->iconify(); } else if (win->isIconic()) win->deiconify(true); if (state & WIN_STATE_SHADED) { -#ifdef DEBUG - cerr<<"Gnome state: Shade"<<endl; -#endif // DEBUG + + fbdbg<<"Gnome state: Shade"<<endl; + if (!win->isShaded()) win->shade(); } else if (win->isShaded())

@@ -436,53 +419,39 @@

switch (layer) { case WIN_LAYER_DESKTOP: -#ifdef DEBUG - cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_DESKTOP)"<<endl; -#endif // DEBUG + fbdbg<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_DESKTOP)"<<endl; layer = Layer::DESKTOP; break; case WIN_LAYER_BELOW: -#ifdef DEBUG - cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_BELOW)"<<endl; -#endif // DEBUG + fbdbg<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_BELOW)"<<endl; layer = Layer::BOTTOM; break; case WIN_LAYER_NORMAL: -#ifdef DEBUG - cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_NORMAL)"<<endl; -#endif // DEBUG + fbdbg<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_NORMAL)"<<endl; layer = Layer::NORMAL; break; case WIN_LAYER_ONTOP: -#ifdef DEBUG - cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_ONTOP)"<<endl; -#endif // DEBUG + fbdbg<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_ONTOP)"<<endl; layer = Layer::TOP; break; case WIN_LAYER_DOCK: -#ifdef DEBUG - cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_DOCK)"<<endl; -#endif // DEBUG + fbdbg<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_DOCK)"<<endl; layer = Layer::DOCK; break; case WIN_LAYER_ABOVE_DOCK: -#ifdef DEBUG - cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_ABOVE_DOCK)"<<endl; -#endif // DEBUG + fbdbg<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_ABOVE_DOCK)"<<endl; layer = Layer::ABOVE_DOCK; break; case WIN_LAYER_MENU: -#ifdef DEBUG - cerr<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_MENU)"<<endl; -#endif // DEBUG + fbdbg<<"Gnome::setLayer("<<win->title()<<", WIN_LAYER_MENU)"<<endl; layer = Layer::MENU; break; default: // our windows are in the opposite direction to gnome layer = Layer::DESKTOP - layer; -#ifdef DEBUG - cerr<<"Gnome::setLayer("<<win->title()<<", "<<layer<<")"<<endl; -#endif // DEBUG + + fbdbg<<"Gnome::setLayer("<<win->title()<<", "<<layer<<")"<<endl; + break; }
M src/IconbarTool.ccsrc/IconbarTool.cc

@@ -35,6 +35,7 @@ #include "WinClient.hh"

#include "FocusControl.hh" #include "FbCommands.hh" #include "Layer.hh" +#include "Debug.hh" #include "FbTk/STLUtil.hh" #include "FbTk/I18n.hh"

@@ -57,11 +58,7 @@ #endif

using std::string; using std::list; - -#ifdef DEBUG -using std::cerr; using std::endl; -#endif // DEBUG namespace FbTk {

@@ -530,9 +527,8 @@ // got window die signal, lets find and remove the window

IconMap::iterator it = m_icons.find(&win); if (it == m_icons.end()) return; -#ifdef DEBUG - cerr<<"IconbarTool::"<<__FUNCTION__<<"( 0x"<<&win<<" title = "<<win.title()<<") found!"<<endl; -#endif // DEBUG + + fbdbg<<"IconbarTool::"<<__FUNCTION__<<"( 0x"<<&win<<" title = "<<win.title()<<") found!"<<endl; // remove from list and render theme again IconButton *button = it->second;

@@ -546,9 +542,9 @@ // we just want windows that have clients

FluxboxWindow *fbwin = win.fbwindow(); if (!fbwin || fbwin->clientList().empty()) return 0; -#ifdef DEBUG - cerr<<"IconbarTool::addWindow(0x"<<&win<<" title = "<<win.title()<<")"<<endl; -#endif // DEBUG + + fbdbg<<"IconbarTool::addWindow(0x"<<&win<<" title = "<<win.title()<<")"<<endl; + IconButton *button = new IconButton(m_icon_container, m_focused_theme, m_unfocused_theme, win);
M src/Keys.ccsrc/Keys.cc

@@ -25,6 +25,7 @@ #include "fluxbox.hh"

#include "Screen.hh" #include "WinClient.hh" #include "WindowCmd.hh" +#include "Debug.hh" #include "FbTk/EventManager.hh" #include "FbTk/StringUtil.hh"

@@ -343,9 +344,8 @@ /**

* Load critical key/mouse bindings for when there are fatal errors reading the keyFile. */ void Keys::loadDefaults() { -#ifdef DEBUG - cerr<<"Loading default key bindings"<<endl; -#endif + fbdbg<<"Loading default key bindings"<<endl; + deleteTree(); m_map["default:"] = new t_key(0,0,0,0,false); addBinding("OnDesktop Mouse1 :HideMenus");
M src/Makefile.amsrc/Makefile.am

@@ -152,6 +152,7 @@ IconbarTheme.hh IconbarTheme.cc \

Focusable.hh FocusableList.hh FocusableList.cc FocusableTheme.hh \ WindowMenuAccessor.hh \ RectangleUtil.hh \ + Debug.hh \ ${newwmspec_SOURCE} ${gnome_SOURCE} \ ${REMEMBER_SOURCE} ${TOOLBAR_SOURCE}
M src/Remember.ccsrc/Remember.cc

@@ -30,6 +30,7 @@ #include "FbMenu.hh"

#include "FbCommands.hh" #include "fluxbox.hh" #include "Layer.hh" +#include "Debug.hh" #include "FbTk/I18n.hh" #include "FbTk/StringUtil.hh"

@@ -389,9 +390,9 @@ // the line was successfully read; we just didn't use it

return true; FbCommands::ExecuteCmd *tmp_exec_cmd = new FbCommands::ExecuteCmd(str, screen); -#ifdef DEBUG - cerr<<"Executing startup Command<void> '"<<str<<"' on screen "<<screen<<endl; -#endif // DEBUG + + fbdbg<<"Executing startup Command<void> '"<<str<<"' on screen "<<screen<<endl; + tmp_exec_cmd->execute(); delete tmp_exec_cmd; return true;

@@ -708,9 +709,8 @@

void Remember::reload() { string apps_string = FbTk::StringUtil::expandFilename(Fluxbox::instance()->getAppsFilename()); -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): Loading apps file ["<<apps_string<<"]"<<endl; -#endif // DEBUG + + fbdbg<<"("<<__FUNCTION__<<"): Loading apps file ["<<apps_string<<"]"<<endl; ifstream apps_file(apps_string.c_str());

@@ -810,9 +810,7 @@ cerr<<"Error in apps file on line "<<row<<"."<<endl;

} } else { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<< ") Empty apps file" << endl; -#endif + fbdbg<<"("<<__FUNCTION__<< ") Empty apps file" << endl; } } else { cerr << "failed to open apps file" << endl;

@@ -857,9 +855,8 @@ void Remember::save() {

string apps_string = FbTk::StringUtil::expandFilename(Fluxbox::instance()->getAppsFilename()); -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): Saving apps file ["<<apps_string<<"]"<<endl; -#endif // DEBUG + fbdbg<<"("<<__FUNCTION__<<"): Saving apps file ["<<apps_string<<"]"<<endl; + ofstream apps_file(apps_string.c_str()); // first of all we output all the startup commands
M src/RootTheme.ccsrc/RootTheme.cc

@@ -47,8 +47,6 @@ #else

#include <string.h> #endif -using std::cerr; -using std::endl; using std::string; class BackgroundItem: public FbTk::ThemeItem<FbTk::Texture> {
M src/Screen.ccsrc/Screen.cc

@@ -54,6 +54,7 @@ #include "FbTk/CommandParser.hh"

#include "AtomHandler.hh" #include "HeadArea.hh" #include "FbCommands.hh" +#include "Debug.hh" #include "FbTk/I18n.hh" #include "FbTk/Subject.hh"

@@ -154,10 +155,8 @@ using std::mem_fun;

using std::bind2nd; using std::equal_to; -#ifdef DEBUG using std::hex; using std::dec; -#endif // DEBUG static bool running = true; namespace {

@@ -631,10 +630,10 @@ if ((wmhints->flags & IconWindowHint) &&

(wmhints->icon_window != children[i])) for (unsigned int j = 0; j < nchild; j++) { if (children[j] == wmhints->icon_window) { -#ifdef DEBUG - cerr<<"BScreen::initWindows(): children[j] = 0x"<<hex<<children[j]<<dec<<endl; - cerr<<"BScreen::initWindows(): = icon_window"<<endl; -#endif // DEBUG + + fbdbg<<"BScreen::initWindows(): children[j] = 0x"<<hex<<children[j]<<dec<<endl; + fbdbg<<"BScreen::initWindows(): = icon_window"<<endl; + children[j] = None; break; }

@@ -664,9 +663,9 @@

if (children[i] == None) continue; else if (!fluxbox->validateWindow(children[i])) { -#ifdef DEBUG - cerr<<"BScreen::initWindows(): not valid window = "<<hex<<children[i]<<dec<<endl; -#endif // DEBUG + + fbdbg<<"BScreen::initWindows(): not valid window = "<<hex<<children[i]<<dec<<endl; + children[i] = None; continue; }

@@ -679,10 +678,9 @@ // add this window back to the beginning of the list of children

children[num_transients] = children[i]; num_transients++; -#ifdef DEBUG - cerr<<"BScreen::initWindows(): postpone creation of 0x"<<hex<<children[i]<<dec<<endl; - cerr<<"BScreen::initWindows(): transient_for = 0x"<<hex<<transient_for<<dec<<endl; -#endif // DEBUG + fbdbg<<"BScreen::initWindows(): postpone creation of 0x"<<hex<<children[i]<<dec<<endl; + fbdbg<<"BScreen::initWindows(): transient_for = 0x"<<hex<<transient_for<<dec<<endl; + continue; }

@@ -1001,9 +999,9 @@ }

} void BScreen::removeWindow(FluxboxWindow *win) { -#ifdef DEBUG - cerr<<"BScreen::removeWindow("<<win<<")"<<endl; -#endif // DEBUG + + fbdbg<<"BScreen::removeWindow("<<win<<")"<<endl; + // extra precaution, if for some reason, the // icon list should be out of sync removeIcon(win);

@@ -1922,9 +1920,8 @@

return other; } void BScreen::clearXinerama() { -#ifdef DEBUG - cerr<<"BScreen::initXinerama(): dont have Xinerama"<<endl; -#endif // DEBUG + fbdbg<<"BScreen::initXinerama(): dont have Xinerama"<<endl; + m_xinerama_avail = false; if (m_xinerama_headinfo) delete [] m_xinerama_headinfo;

@@ -1940,9 +1937,9 @@ if (!XineramaIsActive(display)) {

clearXinerama(); return; } -#ifdef DEBUG - cerr<<"BScreen::initXinerama(): have Xinerama"<<endl; -#endif // DEBUG + + fbdbg<<"BScreen::initXinerama(): have Xinerama"<<endl; + m_xinerama_avail = true; XineramaScreenInfo *screen_info;

@@ -1969,9 +1966,8 @@ m_xinerama_headinfo[i].width = screen_info[i].width;

m_xinerama_headinfo[i].height = screen_info[i].height; } XFree(screen_info); -#ifdef DEBUG - cerr<<"BScreen::initXinerama(): number of heads ="<<number<<endl; -#endif // DEBUG + + fbdbg<<"BScreen::initXinerama(): number of heads ="<<number<<endl; /* Reallocate to the new number of heads. */ int ha_num = numHeads() ? numHeads() : 1, ha_oldnum = m_head_areas.size();
M src/Slit.ccsrc/Slit.cc

@@ -53,6 +53,8 @@

#include "SlitTheme.hh" #include "SlitClient.hh" #include "Xutil.hh" +#include "Debug.hh" + #include "FbTk/App.hh" #include "FbTk/MenuSeparator.hh" #include "FbTk/StringUtil.hh"

@@ -82,12 +84,8 @@ using std::list;

using std::ifstream; using std::ofstream; using std::endl; - -#ifdef DEBUG -using std::cerr; using std::hex; using std::dec; -#endif // DEBUG namespace FbTk {

@@ -393,9 +391,9 @@ screen().updateAvailableWorkspaceArea();

} void Slit::addClient(Window w) { -#ifdef DEBUG - cerr<<__FILE__": addClient(w = 0x"<<hex<<w<<dec<<")"<<endl; -#endif // DEBUG + + fbdbg<<"addClient(w = 0x"<<hex<<w<<dec<<")"<<endl; + // Can't add non existent window if (w == None) return;

@@ -460,12 +458,9 @@ Atom *proto = 0;

int num_return = 0; if (XGetWMProtocols(disp, w, &proto, &num_return)) { - XFree((void *) proto); -#ifdef DEBUG } else { - cerr<<"Warning: Failed to read WM Protocols. "<<endl; -#endif // DEBUG + fbdbg<<"Warning: Failed to read WM Protocols. "<<endl; } XWindowAttributes attrib;
M src/SystemTray.ccsrc/SystemTray.cc

@@ -32,6 +32,7 @@ #include "fluxbox.hh"

#include "WinClient.hh" #include "Screen.hh" #include "ButtonTheme.hh" +#include "Debug.hh" #include <X11/Xutil.h> #include <X11/Xatom.h>

@@ -40,13 +41,10 @@ #include <string>

using std::string; -#ifdef DEBUG -#include <iostream> -using std::cerr; + using std::endl; using std::hex; using std::dec; -#endif // DEBUG /// helper class for tray windows, so we dont call XDestroyWindow class TrayWindow: public FbTk::FbWindow {

@@ -86,9 +84,9 @@ (unsigned char **) &prop) && prop != 0) {

mapped = (bool)(static_cast<unsigned long>(prop[1]) & XEMBED_MAPPED); XFree(static_cast<void *>(prop)); -#ifdef DEBUG - cerr<<__FILE__<<"(SystemTray::TrayWindow::getMappedDefault(): XEMBED_MAPPED = "<<mapped<<endl; -#endif // DEBUG + + fbdbg<<"(SystemTray::TrayWindow::getMappedDefault(): XEMBED_MAPPED = "<<mapped<<endl; + } return true;

@@ -187,16 +185,14 @@ // get selection owner and see if it's free

Atom tray_atom = XInternAtom(disp, atom_name.c_str(), False); Window owner = XGetSelectionOwner(disp, tray_atom); if (owner != 0) { -#ifdef DEBUG - cerr<<__FILE__<<"(SystemTray(const FbTk::FbWindow)): can't set owner!"<<endl; -#endif // DEBUG + fbdbg<<"(SystemTray(const FbTk::FbWindow)): can't set owner!"<<endl; return; // the're can't be more than one owner } // ok, it was free. Lets set owner -#ifdef DEBUG - cerr<<__FILE__<<"(SystemTray(const FbTk::FbWindow)): SETTING OWNER!"<<endl; -#endif // DEBUG + + fbdbg<<"(SystemTray(const FbTk::FbWindow)): SETTING OWNER!"<<endl; + // set owner XSetSelectionOwner(disp, tray_atom, m_selection_owner.window(), CurrentTime);

@@ -311,17 +307,17 @@ if (event.message_type == systray_opcode_atom) {

int type = event.data.l[1]; if (type == SYSTEM_TRAY_REQUEST_DOCK) { -#ifdef DEBUG - cerr<<"SystemTray::clientMessage(const XClientMessageEvent): SYSTEM_TRAY_REQUEST_DOCK"<<endl; - cerr<<"window = event.data.l[2] = "<<event.data.l[2]<<endl; -#endif // DEBUG + + fbdbg<<"SystemTray::clientMessage(const XClientMessageEvent): SYSTEM_TRAY_REQUEST_DOCK"<<endl; + fbdbg<<"window = event.data.l[2] = "<<event.data.l[2]<<endl; + addClient(event.data.l[2], true); } /* else if (type == SYSTEM_TRAY_BEGIN_MESSAGE) - cerr<<"BEGIN MESSAGE"<<endl; + fbdbg<<"BEGIN MESSAGE"<<endl; else if (type == SYSTEM_TRAY_CANCEL_MESSAGE) - cerr<<"CANCEL MESSAGE"<<endl; + fbdbg<<"CANCEL MESSAGE"<<endl; */ return true;

@@ -362,9 +358,7 @@ }

TrayWindow *traywin = new TrayWindow(win, using_xembed); -#ifdef DEBUG - cerr<<"SystemTray::addClient(Window): 0x"<<hex<<win<<dec<<endl; -#endif // DEBUG + fbdbg<<"SystemTray::addClient(Window): 0x"<<hex<<win<<dec<<endl; m_clients.push_back(traywin); FbTk::EventManager::instance()->add(*this, win);

@@ -400,9 +394,8 @@ ClientList::iterator tray_it = findClient(win);

if (tray_it == m_clients.end()) return; -#ifdef DEBUG - cerr<<__FILE__<<"(SystemTray::removeClient(Window)): 0x"<<hex<<win<<dec<<endl; -#endif // DEBUG + fbdbg<<"(SystemTray::removeClient(Window)): 0x"<<hex<<win<<dec<<endl; + TrayWindow *traywin = *tray_it; m_clients.erase(tray_it); if (!destroyed) {
M src/WinClient.ccsrc/WinClient.cc

@@ -26,8 +26,8 @@ #include "fluxbox.hh"

#include "FocusControl.hh" #include "Screen.hh" #include "FbAtoms.hh" - #include "Xutil.hh" +#include "Debug.hh" #include "FbTk/EventManager.hh" #include "FbTk/MultLayers.hh"

@@ -52,13 +52,11 @@

using std::string; using std::list; using std::mem_fun; - -#ifdef DEBUG -using std::cerr; using std::endl; +using std::cerr; using std::hex; using std::dec; -#endif // DEBUG + WinClient::TransientWaitMap WinClient::s_transient_wait;

@@ -110,9 +108,7 @@ updateTransientInfo();

} WinClient::~WinClient() { -#ifdef DEBUG - cerr<<__FILE__<<"(~"<<__FUNCTION__<<")[this="<<this<<"]"<<endl; -#endif // DEBUG + fbdbg<<__FILE__<<"(~"<<__FUNCTION__<<")[this="<<this<<"]"<<endl; FbTk::EventManager::instance()->remove(window());

@@ -175,10 +171,9 @@ return true;

} if (!send_focus_message) return false; -#ifdef DEBUG - cerr<<"WinClient::"<<__FUNCTION__<<": this = "<<this<< + + fbdbg<<"WinClient::"<<__FUNCTION__<<": this = "<<this<< " window = 0x"<<hex<<window()<<dec<<endl; -#endif // DEBUG // setup focus msg XEvent ce;

@@ -241,9 +236,9 @@

void WinClient::updateWMClassHint() { XClassHint ch; if (XGetClassHint(display(), window(), &ch) == 0) { -#ifdef DEBUG - cerr<<"WinClient: Failed to read class hint!"<<endl; -#endif //DEBUG + + fbdbg<<"WinClient: Failed to read class hint!"<<endl; + m_instance_name = m_class_name = ""; } else {

@@ -275,17 +270,14 @@ transient_for = 0;

// determine if this is a transient window Window win = 0; if (!XGetTransientForHint(display(), window(), &win)) { -#ifdef DEBUG - cerr<<__FUNCTION__<<": window() = 0x"<<hex<<window()<<dec<<"Failed to read transient for hint."<<endl; -#endif // DEBUG + + fbdbg<<__FUNCTION__<<": window() = 0x"<<hex<<window()<<dec<<"Failed to read transient for hint."<<endl; return; } // we can't be transient to ourself if (win == window()) { -#ifdef DEBUG cerr<<__FUNCTION__<<": transient to ourself"<<endl; -#endif // DEBUG return; }

@@ -314,10 +306,9 @@ s_transient_wait[win].push_back(this);

} -#ifdef DEBUG - cerr<<__FUNCTION__<<": transient_for window = 0x"<<hex<<win<<dec<<endl; - cerr<<__FUNCTION__<<": transient_for = "<<transient_for<<endl; -#endif // DEBUG + fbdbg<<__FUNCTION__<<": transient_for window = 0x"<<hex<<win<<dec<<endl; + fbdbg<<__FUNCTION__<<": transient_for = "<<transient_for<<endl; + // make sure we don't have deadlock loop in transient chain for (WinClient *w = this; w != 0; w = w->transient_for) { if (this == w->transient_for)

@@ -604,10 +595,9 @@

XFree(proto); if (fbwindow()) fbwindow()->updateFunctions(); -#ifdef DEBUG + } else { - cerr<<"Warning: Failed to read WM Protocols. "<<endl; -#endif // DEBUG + fbdbg<<"Warning: Failed to read WM Protocols. "<<endl; } }
M src/Window.ccsrc/Window.cc

@@ -44,6 +44,7 @@ #include "FocusControl.hh"

#include "IconButton.hh" #include "ScreenPlacement.hh" #include "RectangleUtil.hh" +#include "Debug.hh" #include "FbTk/StringUtil.hh" #include "FbTk/Compose.hh"

@@ -87,7 +88,6 @@ #endif

#include <functional> #include <algorithm> -using std::cerr; using std::endl; using std::string; using std::vector;

@@ -96,13 +96,10 @@ using std::mem_fun;

using std::equal_to; using std::max; using std::swap; +using std::dec; +using std::hex; using namespace FbTk; - -#ifdef DEBUG -using std::dec; -using std::hex; -#endif // DEBUG namespace {

@@ -332,13 +329,11 @@ unregisterWindow(frame().window().window());

} -#ifdef DEBUG const char* title = m_client ? m_client->title().c_str() : "" ; - cerr<<__FILE__<<"("<<__LINE__<<"): starting ~FluxboxWindow("<<this<<","<<title<<")"<<endl; - cerr<<__FILE__<<"("<<__LINE__<<"): num clients = "<<numClients()<<endl; - cerr<<__FILE__<<"("<<__LINE__<<"): curr client = "<<m_client<<endl; - cerr<<__FILE__<<"("<<__LINE__<<"): m_labelbuttons.size = "<<m_labelbuttons.size()<<endl; -#endif // DEBUG + fbdbg<<"starting ~FluxboxWindow("<<this<<","<<title<<")"<<endl; + fbdbg<<"num clients = "<<numClients()<<endl; + fbdbg<<"curr client = "<<m_client<<endl; + fbdbg<<"m_labelbuttons.size = "<<m_labelbuttons.size()<<endl; if (moving) stopMoving(true);

@@ -368,7 +363,7 @@ delete m_client; // this also removes client from our list

m_client = 0; if (m_clientlist.size() > 1) { - cerr<<__FILE__<<"(~FluxboxWindow()) WARNING! clientlist > 1"<<endl; + fbdbg<<"(~FluxboxWindow()) WARNING! clientlist > 1"<<endl; while (!m_clientlist.empty()) { detachClient(*m_clientlist.back()); }

@@ -377,9 +372,8 @@

if (!screen().isShuttingdown()) screen().focusControl().removeWindow(*this); -#ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): ~FluxboxWindow("<<this<<")"<<endl; -#endif // DEBUG + + fbdbg<<"~FluxboxWindow("<<this<<")"<<endl; }

@@ -406,11 +400,9 @@

//!! TODO init of client should be better // we don't want to duplicate code here and in attachClient m_clientlist.push_back(m_client); -#ifdef DEBUG - cerr<<__FILE__<<": FluxboxWindow::init(this="<<this<<", client="<<hex<< - m_client->window()<<", frame = "<<frame().window().window()<<dec<<")"<<endl; -#endif // DEBUG + fbdbg<<"FluxboxWindow::init(this="<<this<<", client="<<hex<< + m_client->window()<<", frame = "<<frame().window().window()<<dec<<")"<<endl; Fluxbox &fluxbox = *Fluxbox::instance();

@@ -495,14 +487,13 @@ m_client->transientFor()->fbwindow()->workspaceNumber();

} else // if no parent then set default layer moveToLayer(m_state.layernum, m_state.layernum != ::Layer::NORMAL); -#ifdef DEBUG - cerr<<"FluxboxWindow::init("<<title()<<") transientFor: "<< - m_client->transientFor()<<endl; + fbdbg<<"FluxboxWindow::init("<<title()<<") transientFor: "<< + m_client->transientFor()<<endl; if (m_client->transientFor() && m_client->transientFor()->fbwindow()) { - cerr<<"FluxboxWindow::init("<<title()<<") transientFor->title(): "<< - m_client->transientFor()->fbwindow()->title()<<endl; + fbdbg<<"FluxboxWindow::init("<<title()<<") transientFor->title(): "<< + m_client->transientFor()->fbwindow()->title()<<endl; } -#endif // DEBUG + unsigned int real_width = frame().width(), real_height = frame().height(); frame().applySizeHints(real_width, real_height);

@@ -699,9 +690,9 @@ bool FluxboxWindow::removeClient(WinClient &client) {

if (client.fbwindow() != this || numClients() == 0) return false; -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl; -#endif // DEBUG + + fbdbg<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl; + // if it is our active client, deal with it... if (m_client == &client) {

@@ -735,9 +726,7 @@ m_labelbuttons.erase(&client);

frame().reconfigure(); updateClientLeftWindow(); -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"] numClients = "<<numClients()<<endl; -#endif // DEBUG + fbdbg<<"("<<__FUNCTION__<<")["<<this<<"] numClients = "<<numClients()<<endl; return true; }

@@ -995,10 +984,8 @@ if (old)

old->focusSig().notify(); } -#ifdef DEBUG - cerr<<"FluxboxWindow::"<<__FUNCTION__<<": labelbutton[client] = "<< + fbdbg<<"FluxboxWindow::"<<__FUNCTION__<<": labelbutton[client] = "<< button<<endl; -#endif // DEBUG if (old != &client) { titleSig().notify();

@@ -1300,23 +1287,19 @@ // this needs to be here rather than setFocusFlag because

// FocusControl::revertFocus will return before FocusIn events arrive m_screen.focusControl().setScreenFocusedWindow(*m_client); -#ifdef DEBUG - cerr<<"FluxboxWindow::"<<__FUNCTION__<<" isModal() = "<<m_client->isModal()<<endl; - cerr<<"FluxboxWindow::"<<__FUNCTION__<<" transient size = "<<m_client->transients.size()<<endl; -#endif // DEBUG + + fbdbg<<"FluxboxWindow::"<<__FUNCTION__<<" isModal() = "<<m_client->isModal()<<endl; + fbdbg<<"FluxboxWindow::"<<__FUNCTION__<<" transient size = "<<m_client->transients.size()<<endl; + if (!m_client->transients.empty() && m_client->isModal()) { -#ifdef DEBUG - cerr<<__FUNCTION__<<": isModal and have transients client = "<< + fbdbg<<__FUNCTION__<<": isModal and have transients client = "<< hex<<m_client->window()<<dec<<endl; - cerr<<__FUNCTION__<<": this = "<<this<<endl; -#endif // DEBUG + fbdbg<<__FUNCTION__<<": this = "<<this<<endl; WinClient::TransientList::iterator it = m_client->transients.begin(); WinClient::TransientList::iterator it_end = m_client->transients.end(); for (; it != it_end; ++it) { -#ifdef DEBUG - cerr<<__FUNCTION__<<": transient 0x"<<(*it)<<endl; -#endif // DEBUG + fbdbg<<__FUNCTION__<<": transient 0x"<<(*it)<<endl; if ((*it)->isStateModal()) return (*it)->focus(); }

@@ -1330,9 +1313,8 @@ }

// don't hide the frame directly, use this function void FluxboxWindow::hide(bool interrupt_moving) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl; -#endif // DEBUG + fbdbg<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl; + // resizing always stops on hides if (resizing) stopResizing(true);

@@ -1555,9 +1537,7 @@ m_workspace_number = n;

// notify workspace change if (m_initialized && old_wkspc != m_workspace_number) { -#ifdef DEBUG - cerr<<this<<" notify workspace signal"<<endl; -#endif // DEBUG + fbdbg<<this<<" notify workspace signal"<<endl; m_workspacesig.notify(); } }

@@ -1566,10 +1546,7 @@ void FluxboxWindow::setLayerNum(int layernum) {

m_state.layernum = layernum; if (m_initialized) { -#ifdef DEBUG - cerr<<this<<" notify layer signal"<<endl; -#endif // DEBUG - + fbdbg<<this<<" notify layer signal"<<endl; m_layersig.notify(); } }

@@ -1643,9 +1620,9 @@

void FluxboxWindow::raise() { if (isIconic()) return; -#ifdef DEBUG - cerr<<"FluxboxWindow("<<title()<<")::raise()[layer="<<layerNum()<<"]"<<endl; -#endif // DEBUG + + fbdbg<<"FluxboxWindow("<<title()<<")::raise()[layer="<<layerNum()<<"]"<<endl; + // get root window WinClient *client = getRootTransientFor(m_client);

@@ -1671,9 +1648,8 @@

void FluxboxWindow::lower() { if (isIconic()) return; -#ifdef DEBUG - cerr<<"FluxboxWindow("<<title()<<")::lower()"<<endl; -#endif // DEBUG + + fbdbg<<"FluxboxWindow("<<title()<<")::lower()"<<endl; /* Ignore all EnterNotify events until the pointer actually moves */ screen().focusControl().ignoreAtPointer();

@@ -1703,9 +1679,8 @@ moveToLayer(m_state.layernum+diff);

} void FluxboxWindow::moveToLayer(int layernum, bool force) { -#ifdef DEBUG - cerr<<"FluxboxWindow("<<title()<<")::moveToLayer("<<layernum<<")"<<endl; -#endif // DEBUG + + fbdbg<<"FluxboxWindow("<<title()<<")::moveToLayer("<<layernum<<")"<<endl; // don't let it set its layer into menu area if (layernum <= ::Layer::MENU)

@@ -1769,9 +1744,9 @@ if (!m_client) return;

bool was_focused = isFocused(); m_focused = focus; -#ifdef DEBUG - cerr<<"FluxboxWindow("<<title()<<")::setFocusFlag("<<focus<<")"<<endl; -#endif // DEBUG + + fbdbg<<"FluxboxWindow("<<title()<<")::setFocusFlag("<<focus<<")"<<endl; + installColormap(focus);

@@ -1961,9 +1936,7 @@ */

void FluxboxWindow::handleEvent(XEvent &event) { switch (event.type) { case ConfigureRequest: -#ifdef DEBUG - cerr<<"ConfigureRequest("<<title()<<")"<<endl; -#endif // DEBUG + fbdbg<<"ConfigureRequest("<<title()<<")"<<endl; configureRequestEvent(event.xconfigurerequest); break;

@@ -1978,7 +1951,7 @@ case PropertyNotify: {

#ifdef DEBUG char *atomname = XGetAtomName(display, event.xproperty.atom); - cerr<<"PropertyNotify("<<title()<<"), property = "<<atomname<<endl; + fbdbg<<"PropertyNotify("<<title()<<"), property = "<<atomname<<endl; if (atomname) XFree(atomname); #endif // DEBUG

@@ -1993,9 +1966,9 @@ default:

#ifdef SHAPE if (Fluxbox::instance()->haveShape() && event.type == Fluxbox::instance()->shapeEventbase() + ShapeNotify) { -#ifdef DEBUG - cerr<<"ShapeNotify("<<title()<<")"<<endl; -#endif // DEBUG + + fbdbg<<"ShapeNotify("<<title()<<")"<<endl; + XShapeEvent *shape_event = (XShapeEvent *)&event; if (shape_event->shaped)

@@ -2017,9 +1990,7 @@

// we're only concerned about client window event WinClient *client = findClient(re.window); if (client == 0) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): Can't find client!"<<endl; -#endif // DEBUG + fbdbg<<"("<<__FUNCTION__<<"): Can't find client!"<<endl; return; }

@@ -2089,10 +2060,9 @@ WinClient *client = findClient(ue.window);

if (client == 0) return; -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<client->window()<<dec<<endl; - cerr<<__FILE__<<"("<<__FUNCTION__<<"): title="<<client->title()<<endl; -#endif // DEBUG + + fbdbg<<"("<<__FUNCTION__<<"): 0x"<<hex<<client->window()<<dec<<endl; + fbdbg<<"("<<__FUNCTION__<<"): title="<<client->title()<<endl; restore(client, false);

@@ -2105,9 +2075,7 @@ we just hide it for now.

*/ void FluxboxWindow::destroyNotifyEvent(XDestroyWindowEvent &de) { if (de.window == m_client->window()) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): DestroyNotifyEvent this="<<this<<" title = "<<title()<<endl; -#endif // DEBUG + fbdbg<<"DestroyNotifyEvent this="<<this<<" title = "<<title()<<endl; delete m_client; if (numClients() == 0) delete this;

@@ -2149,9 +2117,7 @@ client.updateTitle();

break; case XA_WM_NORMAL_HINTS: { -#ifdef DEBUG - cerr<<"XA_WM_NORMAL_HINTS("<<title()<<")"<<endl; -#endif // DEBUG + fbdbg<<"XA_WM_NORMAL_HINTS("<<title()<<")"<<endl; unsigned int old_max_width = client.maxWidth(); unsigned int old_min_width = client.minWidth(); unsigned int old_min_height = client.minHeight();

@@ -2396,9 +2362,8 @@ if (frame().window().window() == be.window ||

frame().tabcontainer().window() == be.window) { if (screen().clickRaises()) raise(); -#ifdef DEBUG - cerr<<"FluxboxWindow::buttonPressEvent: AllowEvent"<<endl; -#endif // DEBUG + + fbdbg<<"FluxboxWindow::buttonPressEvent: AllowEvent"<<endl; XAllowEvents(display, ReplayPointer, be.time);

@@ -3317,10 +3282,9 @@

XEvent xev; if (! XCheckTypedWindowEvent(display, client->window(), ReparentNotify, &xev)) { -#ifdef DEBUG - cerr<<"FluxboxWindow::restore: reparent 0x"<<hex<<client->window()<<dec<<" to root"<<endl; + + fbdbg<<"FluxboxWindow::restore: reparent 0x"<<hex<<client->window()<<dec<<" to root"<<endl; -#endif // DEBUG // reparent to root window client->reparent(screen().rootWindow(), wx, wy, false);

@@ -3336,10 +3300,9 @@

delete client; -#ifdef DEBUG - cerr<<"FluxboxWindow::restore: remap = "<<remap<<endl; - cerr<<__FILE__<<"("<<__FUNCTION__<<"): numClients() = "<<numClients()<<endl; -#endif // DEBUG + fbdbg<<"FluxboxWindow::restore: remap = "<<remap<<endl; + fbdbg<<"("<<__FUNCTION__<<"): numClients() = "<<numClients()<<endl; + if (numClients() == 0) delete this;

@@ -3348,9 +3311,9 @@

void FluxboxWindow::restore(bool remap) { if (numClients() == 0) return; -#ifdef DEBUG - cerr<<"restore("<<remap<<")"<<endl; -#endif // DEBUG + + fbdbg<<"restore("<<remap<<")"<<endl; + while (!clientList().empty()) { restore(clientList().back(), remap); // deleting winClient removes it from the clientList
M src/Workspace.ccsrc/Workspace.cc

@@ -63,12 +63,6 @@ #include <algorithm>

using std::string; -#ifdef DEBUG -#include <iostream> -using std::cerr; -using std::endl; -#endif // DEBUG - Workspace::Workspace(BScreen &scrn, const string &name, unsigned int id): m_screen(scrn), m_clientmenu(scrn, m_windowlist, false),
M src/Xutil.ccsrc/Xutil.cc

@@ -21,6 +21,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE. #include "Xutil.hh" +#include "Debug.hh" #include "FbTk/I18n.hh" #include "FbTk/App.hh"

@@ -37,11 +38,8 @@ #endif

using std::string; using std::strlen; +using std::endl; -#ifdef DEBUG -using std::cerr; -using std::endl; -#endif // DEBUG namespace Xutil {

@@ -97,9 +95,8 @@ XClassHint ch;

string instance_name; if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { -#ifdef DEBUG - cerr<<"Xutil: Failed to read class hint!"<<endl; -#endif //DEBUG + fbdbg<<"Xutil: Failed to read class hint!"<<endl; + instance_name = ""; } else {

@@ -123,9 +120,7 @@ XClassHint ch;

string class_name; if (XGetClassHint(FbTk::App::instance()->display(), win, &ch) == 0) { -#ifdef DEBUG - cerr<<"Xutil: Failed to read class hint!"<<endl; -#endif //DEBUG + fbdbg<<"Xutil: Failed to read class hint!"<<endl; class_name = ""; } else {
M src/fluxbox.ccsrc/fluxbox.cc

@@ -36,6 +36,7 @@ #include "FocusControl.hh"

#include "Layer.hh" #include "defaults.hh" +#include "Debug.hh" #include "FbTk/I18n.hh" #include "FbTk/Image.hh"

@@ -141,11 +142,8 @@ using std::pair;

using std::bind2nd; using std::mem_fun; using std::equal_to; - -#ifdef DEBUG using std::hex; using std::dec; -#endif // DEBUG using namespace FbTk;

@@ -407,10 +405,10 @@

m_resourcemanager.unlock(); ungrab(); -#ifdef DEBUG - if (m_resourcemanager.lockDepth() != 0) - cerr<<"--- resource manager lockdepth = "<<m_resourcemanager.lockDepth()<<endl; -#endif //DEBUG + if (m_resourcemanager.lockDepth() != 0) { + fbdbg<<"--- resource manager lockdepth = "<<m_resourcemanager.lockDepth()<<endl; + } + m_starting = false; // // For dumping theme items

@@ -494,10 +492,8 @@ if (last_bad_window != None && e.xany.window == last_bad_window &&

e.type != DestroyNotify) { // we must let the actual destroys through if (e.type == FocusOut) revertFocus(); -#ifdef DEBUG else - cerr<<"Fluxbox::eventLoop(): removing bad window from event queue"<<endl; -#endif // DEBUG + fbdbg<<"Fluxbox::eventLoop(): removing bad window from event queue"<<endl; } else { last_bad_window = None; handleEvent(&e);

@@ -568,9 +564,7 @@ if (stat(windowmenu_file.c_str(), &buf))

create_windowmenu = true; } else { -#ifdef DEBUG - cerr <<__FILE__<<"("<<__LINE__<<"): Creating dir: " << dirname.c_str() << endl; -#endif // DEBUG + fbdbg<<"Creating dir: " << dirname.c_str() << endl; _FB_USES_NLS; // create directory with perm 700 if (mkdir(dirname.c_str(), 0700)) {

@@ -715,10 +709,7 @@ }

break; case MapRequest: { -#ifdef DEBUG - cerr<<"MapRequest for 0x"<<hex<<e->xmaprequest.window<<dec<<endl; - -#endif // DEBUG + fbdbg<<"MapRequest for 0x"<<hex<<e->xmaprequest.window<<dec<<endl; WinClient *winclient = searchWindow(e->xmaprequest.window);

@@ -764,9 +755,8 @@ handleUnmapNotify(e->xunmap);

break; case MappingNotify: // Update stored modifier mapping -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): MappingNotify"<<endl; -#endif // DEBUG + fbdbg<<"MappingNotify"<<endl; + if (e->xmapping.request == MappingKeyboard || e->xmapping.request == MappingModifier) { XRefreshKeyboardMapping(&e->xmapping);

@@ -942,7 +932,7 @@ char * atom = 0;

if (ce.message_type) atom = XGetAtomName(FbTk::App::instance()->display(), ce.message_type); - cerr<<__FILE__<<"("<<__LINE__<<"): ClientMessage. data.l[0]=0x"<<hex<<ce.data.l[0]<< + fbdbg<<__FILE__<<"("<<__LINE__<<"): ClientMessage. data.l[0]=0x"<<hex<<ce.data.l[0]<< " message_type=0x"<<ce.message_type<<dec<<" = \""<<atom<<"\""<<endl; if (ce.message_type && atom) XFree((char *) atom);

@@ -1295,9 +1285,9 @@

XrmMergeDatabases(new_blackboxrc, &old_blackboxrc); //merge database together XrmPutFileDatabase(old_blackboxrc, dbfile.c_str()); XrmDestroyDatabase(old_blackboxrc); -#ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): ------------ SAVING DONE"<<endl; -#endif // DEBUG + + fbdbg<<__FILE__<<"("<<__LINE__<<"): ------------ SAVING DONE"<<endl; + } /// @return filename of resource file