compile with -Wall -W -pendantic when --enable-debug is set.
@@ -717,7 +717,7 @@
PACKAGE=openbox -VERSION=1.1.1 +VERSION=1.2.0 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }@@ -2737,7 +2737,7 @@ if test "${enable_debug+set}" = set; then
enableval="$enable_debug" if test x$enableval = "xyes"; then echo "$ac_t""yes" 1>&6 - DEBUG="-DDEBUG" + DEBUG="-DDEBUG -Wall -W -pedantic" else echo "$ac_t""no" 1>&6 fi
@@ -1,7 +1,7 @@
dnl configure.in for Openbox dnl Initialize autoconf and automake AC_INIT(src/openbox.cc) -AM_INIT_AUTOMAKE(openbox,1.1.1,no-define) +AM_INIT_AUTOMAKE(openbox,1.2.0,no-define) dnl Determine default prefix test x$prefix = "xNONE" && prefix="$ac_default_prefix"@@ -172,7 +172,7 @@ AC_ARG_ENABLE(debug,
[ --enable-debug include verbose debugging code [default=no]], if test x$enableval = "xyes"; then AC_MSG_RESULT([yes]) - DEBUG="-DDEBUG" + DEBUG="-DDEBUG -Wall -W -pedantic" else AC_MSG_RESULT([no]) fi,
@@ -276,7 +276,7 @@ { return net_wm_ping; }
#endif // NEWWMSPEC - inline ScreenInfo *getScreenInfo(int s) { + inline ScreenInfo *getScreenInfo(unsigned int s) { ASSERT(s < screenInfoList.size()); return screenInfoList[s]; }
@@ -33,8 +33,8 @@
#include "Netizen.h" #include "Screen.h" -Netizen::Netizen(BScreen &scr, Window win) : screen(scr), - basedisplay(scr.getBaseDisplay()), window(win) +Netizen::Netizen(BScreen &scr, Window win) :basedisplay(scr.getBaseDisplay()), + screen(scr), window(win) { event.type = ClientMessage; event.xclient.message_type = basedisplay.getOpenboxStructureMessagesAtom();
@@ -583,7 +583,7 @@ if (!resource.full_max) {
#ifdef SLIT int slit_x = slit->autoHide() ? slit->hiddenOrigin().x() : slit->area().x(), slit_y = slit->autoHide() ? slit->hiddenOrigin().y() : slit->area().y(); - int tbarh = resource.hide_toolbar ? 0 : + unsigned int tbarh = resource.hide_toolbar ? 0 : toolbar->getExposedHeight() + resource.border_width * 2; bool tbartop; switch (toolbar->placement()) {@@ -1836,7 +1836,7 @@ getScreenNumber()));
// load bevel, border and handle widths if (conf.getValue("handleWidth", "HandleWidth", l)) { - if (l <= size().w() / 2 && l != 0) + if (l <= (signed)size().w() / 2 && l != 0) resource.handle_width = l; else resource.handle_width = 6;@@ -1849,7 +1849,7 @@ else
resource.border_width = 1; if (conf.getValue("bevelWidth", "BevelWidth", l)) { - if (l <= size().w() / 2 && l != 0) + if (l <= (signed)size().w() / 2 && l != 0) resource.bevel_width = l; else resource.bevel_width = 3;@@ -1857,7 +1857,7 @@ } else
resource.bevel_width = 3; if (conf.getValue("frameWidth", "FrameWidth", l)) { - if (l <= size().w() / 2) + if (l <= (signed)size().w() / 2) resource.frame_width = l; else resource.frame_width = resource.bevel_width;@@ -1912,7 +1912,7 @@ }
OpenboxWindow *BScreen::getIcon(int index) { - if (index < 0 || index >= iconList.size()) + if (index < 0 || index >= (signed)iconList.size()) return (OpenboxWindow *) 0; winList::iterator it = iconList.begin();@@ -2021,7 +2021,6 @@
void BScreen::removeNetizen(Window w) { netList::iterator it; - int i = 0; for (it = netizenList.begin(); it != netizenList.end(); ++it) if ((*it)->getWindowID() == w) {@@ -2147,7 +2146,7 @@ }
const char *BScreen::getNameOfWorkspace(int id) { - if (id < 0 || id >= workspaceNames.size()) + if (id < 0 || id >= (signed)workspaceNames.size()) return (const char *) 0; return workspaceNames[id].c_str(); }
@@ -197,7 +197,7 @@ inline Toolbar *getToolbar() { return toolbar; }
Rect availableArea() const; - inline Workspace *getWorkspace(int w) { + inline Workspace *getWorkspace(unsigned int w) { ASSERT(w < workspacesList.size()); return workspacesList[w]; }
@@ -45,8 +45,8 @@ #include <strstream>
#include <string> using std::ends; -Slit::Slit(BScreen &scr, Resource &conf) : screen(scr), - openbox(scr.getOpenbox()), config(conf) +Slit::Slit(BScreen &scr, Resource &conf) : openbox(scr.getOpenbox()), + screen(scr), config(conf) { load();
@@ -66,8 +66,8 @@ #include <strstream>
#include <string> using std::ends; -Toolbar::Toolbar(BScreen &scrn, Resource &conf) : screen(scrn), - openbox(scrn.getOpenbox()), config(conf) +Toolbar::Toolbar(BScreen &scrn, Resource &conf) : openbox(scrn.getOpenbox()), + screen(scrn), config(conf) { load();
@@ -93,9 +93,9 @@ virtual void timeout();
} hide_handler; Openbox &openbox; + BScreen &screen; Resource &config; BImageControl *image_ctrl; - BScreen &screen; BTimer *clock_timer, *hide_timer; Toolbarmenu *toolbarmenu;
@@ -721,7 +721,7 @@ }
} -void OpenboxWindow::positionButtons(Bool redecorate_label) { +void OpenboxWindow::positionButtons() { const char *format = openbox.getTitleBarLayout(); const unsigned int bw = frame.bevel_w + 1; const unsigned int by = frame.bevel_w + 1;@@ -785,23 +785,19 @@ break;
} } - if (!hasclose) { - openbox.removeWindowSearch(frame.close_button); - XDestroyWindow(display, frame.close_button); - frame.close_button = None; + if (!hasclose && frame.close_button) { + openbox.removeWindowSearch(frame.close_button); + XDestroyWindow(display, frame.close_button); } - if (!hasiconify) { - openbox.removeWindowSearch(frame.iconify_button); - XDestroyWindow(display, frame.iconify_button); - frame.iconify_button = None; + if (!hasiconify && frame.iconify_button) { + openbox.removeWindowSearch(frame.iconify_button); + XDestroyWindow(display, frame.iconify_button); } - if (!hasmaximize) { - openbox.removeWindowSearch(frame.maximize_button); - XDestroyWindow(display, frame.maximize_button); - frame.maximize_button = None; + if (!hasmaximize && frame.iconify_button) { + openbox.removeWindowSearch(frame.maximize_button); + XDestroyWindow(display, frame.maximize_button); } - if (redecorate_label) - decorateLabel(); + redrawLabel(); redrawAllButtons(); }@@ -1302,10 +1298,9 @@ #endif // SHAPE
XMoveWindow(display, frame.window, frame.x, frame.y); + setFocusFlag(flags.focused); positionWindows(); decorate(); - setFocusFlag(flags.focused); - redrawAllButtons(); } else { frame.x = dx; frame.y = dy;@@ -1534,7 +1529,7 @@
openbox_attrib.premax_x = openbox_attrib.premax_y = 0; openbox_attrib.premax_w = openbox_attrib.premax_h = 0; - redrawAllButtons(); + redrawMaximizeButton(flags.maximized); setState(current_state); return; }@@ -1608,7 +1603,7 @@ flags.maximized = button;
configure(dx, dy, dw, dh); screen->getWorkspace(workspace_number)->raiseWindow(this); - redrawAllButtons(); + redrawMaximizeButton(flags.maximized); setState(current_state); }@@ -2241,11 +2236,7 @@ && (flags.visible)) {
openbox.grab(); if (! validateClient()) return; - if (decorations.titlebar) positionButtons(); - setState(NormalState); - - redrawAllButtons(); if (flags.transient || screen->focusNew()) setInputFocus();@@ -2410,7 +2401,10 @@ getWMProtocols();
if (decorations.close && (! frame.close_button)) { createCloseButton(); - if (decorations.titlebar) positionButtons(True); + if (decorations.titlebar) { + positionButtons(); + decorateLabel(); + } if (windowmenu) windowmenu->reconfigure(); } }
@@ -220,7 +220,7 @@ void setNetWMAttributes();
void associateClientWindow(); void decorate(); void decorateLabel(); - void positionButtons(Bool redecorate_label = False); + void positionButtons(); void positionWindows(); void createCloseButton(); void createIconifyButton();
@@ -81,7 +81,7 @@ delete [] name;
} -const int Workspace::addWindow(OpenboxWindow *w, Bool place) { +int Workspace::addWindow(OpenboxWindow *w, bool place) { if (! w) return -1; if (place) placeWindow(*w);@@ -103,7 +103,7 @@ return w->getWindowNumber();
} -const int Workspace::removeWindow(OpenboxWindow *w) { +int Workspace::removeWindow(OpenboxWindow *w) { if (! w) return -1; _zorder.remove(w);@@ -190,7 +190,7 @@ Window *nstack = new Window[i], *curr = nstack;
Workspace *wkspc; win = bottom; - while (True) { + while (true) { *(curr++) = win->getFrameWindow(); screen.updateNetizenWindowRaise(win->getClientWindow());@@ -229,7 +229,7 @@
Window *nstack = new Window[i], *curr = nstack; Workspace *wkspc; - while (True) { + while (true) { *(curr++) = win->getFrameWindow(); screen.updateNetizenWindowLower(win->getClientWindow());@@ -267,25 +267,25 @@ }
OpenboxWindow *Workspace::getWindow(int index) { - if ((index >= 0) && (index < _windows.size())) + if ((index >= 0) && (index < (signed)_windows.size())) return _windows[index]; else return (OpenboxWindow *) 0; } -const int Workspace::getCount(void) { - return _windows.size(); +int Workspace::getCount(void) { + return (signed)_windows.size(); } void Workspace::update(void) { clientmenu->update(); - screen.getToolbar()->redrawWindowLabel(True); + screen.getToolbar()->redrawWindowLabel(true); } -Bool Workspace::isCurrent(void) { +bool Workspace::isCurrent(void) { return (id == screen.getCurrentWorkspaceID()); }
@@ -68,15 +68,15 @@
inline BScreen &getScreen(void) { return screen; } inline Clientmenu *getMenu(void) { return clientmenu; } inline const char *getName(void) const { return name; } - inline const int &getWorkspaceID(void) const { return id; } + inline int getWorkspaceID(void) const { return id; } inline OpenboxWindow *focusedWindow() { return _focused; } inline OpenboxWindow *lastFocusedWindow() { return _last; } void focusWindow(OpenboxWindow *win); OpenboxWindow *getWindow(int); - Bool isCurrent(void); - const int addWindow(OpenboxWindow *, Bool = False); - const int removeWindow(OpenboxWindow *); - const int getCount(void); + bool isCurrent(void); + int addWindow(OpenboxWindow *, bool = false); + int removeWindow(OpenboxWindow *); + int getCount(void); void showAll(void); void hideAll(void); void removeAll(void);