compile with -Wall -W -pendantic when --enable-debug is set.
This commit is contained in:
parent
f00ed578ba
commit
1b1efab489
16 changed files with 86 additions and 96 deletions
4
configure
vendored
4
configure
vendored
|
@ -717,7 +717,7 @@ fi
|
||||||
|
|
||||||
PACKAGE=openbox
|
PACKAGE=openbox
|
||||||
|
|
||||||
VERSION=1.1.1
|
VERSION=1.2.0
|
||||||
|
|
||||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
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; }
|
{ 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"
|
enableval="$enable_debug"
|
||||||
if test x$enableval = "xyes"; then
|
if test x$enableval = "xyes"; then
|
||||||
echo "$ac_t""yes" 1>&6
|
echo "$ac_t""yes" 1>&6
|
||||||
DEBUG="-DDEBUG"
|
DEBUG="-DDEBUG -Wall -W -pedantic"
|
||||||
else
|
else
|
||||||
echo "$ac_t""no" 1>&6
|
echo "$ac_t""no" 1>&6
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
dnl configure.in for Openbox
|
dnl configure.in for Openbox
|
||||||
dnl Initialize autoconf and automake
|
dnl Initialize autoconf and automake
|
||||||
AC_INIT(src/openbox.cc)
|
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
|
dnl Determine default prefix
|
||||||
test x$prefix = "xNONE" && prefix="$ac_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]],
|
[ --enable-debug include verbose debugging code [default=no]],
|
||||||
if test x$enableval = "xyes"; then
|
if test x$enableval = "xyes"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
DEBUG="-DDEBUG"
|
DEBUG="-DDEBUG -Wall -W -pedantic"
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi,
|
fi,
|
||||||
|
|
|
@ -276,7 +276,7 @@ public:
|
||||||
|
|
||||||
#endif // NEWWMSPEC
|
#endif // NEWWMSPEC
|
||||||
|
|
||||||
inline ScreenInfo *getScreenInfo(int s) {
|
inline ScreenInfo *getScreenInfo(unsigned int s) {
|
||||||
ASSERT(s < screenInfoList.size());
|
ASSERT(s < screenInfoList.size());
|
||||||
return screenInfoList[s];
|
return screenInfoList[s];
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,7 @@ int Basemenu::insert(const char **ulabel, int pos, int function) {
|
||||||
|
|
||||||
|
|
||||||
int Basemenu::remove(int index) {
|
int Basemenu::remove(int index) {
|
||||||
if (index < 0 || index > menuitems.size()) return -1;
|
if (index < 0 || index > (signed)menuitems.size()) return -1;
|
||||||
|
|
||||||
BasemenuItem *item = menuitems[index];
|
BasemenuItem *item = menuitems[index];
|
||||||
menuitems.erase(menuitems.begin() + index);
|
menuitems.erase(menuitems.begin() + index);
|
||||||
|
@ -413,7 +413,7 @@ void Basemenu::update(void) {
|
||||||
|
|
||||||
if (title_vis && visible) redrawTitle();
|
if (title_vis && visible) redrawTitle();
|
||||||
|
|
||||||
for (int i = 0; visible && i < menuitems.size(); i++) {
|
for (int i = 0; visible && i < (signed)menuitems.size(); i++) {
|
||||||
if (i == which_sub) {
|
if (i == which_sub) {
|
||||||
drawItem(i, True, 0);
|
drawItem(i, True, 0);
|
||||||
drawSubmenu(i);
|
drawSubmenu(i);
|
||||||
|
@ -531,7 +531,7 @@ void Basemenu::drawSubmenu(int index) {
|
||||||
itmp->submenu()->internal_hide();
|
itmp->submenu()->internal_hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index >= 0 && index < menuitems.size()) {
|
if (index >= 0 && index < (signed)menuitems.size()) {
|
||||||
BasemenuItem *item = menuitems[index];
|
BasemenuItem *item = menuitems[index];
|
||||||
if (item->submenu() && visible && (! item->submenu()->isTorn()) &&
|
if (item->submenu() && visible && (! item->submenu()->isTorn()) &&
|
||||||
item->isEnabled()) {
|
item->isEnabled()) {
|
||||||
|
@ -584,19 +584,17 @@ void Basemenu::drawSubmenu(int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bool Basemenu::hasSubmenu(int index) {
|
bool Basemenu::hasSubmenu(int index) {
|
||||||
if ((index >= 0) && (index < menuitems.size()))
|
if (index < 0 | index >= (signed)menuitems.size())
|
||||||
if (menuitems[index]->submenu())
|
return false;
|
||||||
return True;
|
return (menuitems[index]->submenu());
|
||||||
|
|
||||||
return False;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Basemenu::drawItem(int index, Bool highlight, Bool clear,
|
void Basemenu::drawItem(int index, Bool highlight, Bool clear,
|
||||||
int x, int y, unsigned int w, unsigned int h)
|
int x, int y, unsigned int w, unsigned int h)
|
||||||
{
|
{
|
||||||
if (index < 0 || index > menuitems.size()) return;
|
if (index < 0 || index > (signed)menuitems.size()) return;
|
||||||
|
|
||||||
BasemenuItem *item = menuitems[index];
|
BasemenuItem *item = menuitems[index];
|
||||||
if (! item) return;
|
if (! item) return;
|
||||||
|
@ -773,8 +771,8 @@ void Basemenu::setLabel(const char *l) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Basemenu::setItemSelected(int index, Bool sel) {
|
void Basemenu::setItemSelected(int index, bool sel) {
|
||||||
if (index < 0 || index >= menuitems.size()) return;
|
if (index < 0 || index >= (signed)menuitems.size()) return;
|
||||||
|
|
||||||
BasemenuItem *item = find(index);
|
BasemenuItem *item = find(index);
|
||||||
if (! item) return;
|
if (! item) return;
|
||||||
|
@ -784,18 +782,18 @@ void Basemenu::setItemSelected(int index, Bool sel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bool Basemenu::isItemSelected(int index) {
|
bool Basemenu::isItemSelected(int index) {
|
||||||
if (index < 0 || index >= menuitems.size()) return False;
|
if (index < 0 || index >= (signed)menuitems.size()) return false;
|
||||||
|
|
||||||
BasemenuItem *item = find(index);
|
BasemenuItem *item = find(index);
|
||||||
if (! item) return False;
|
if (! item) return false;
|
||||||
|
|
||||||
return item->isSelected();
|
return item->isSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Basemenu::setItemEnabled(int index, Bool enable) {
|
void Basemenu::setItemEnabled(int index, bool enable) {
|
||||||
if (index < 0 || index >= menuitems.size()) return;
|
if (index < 0 || index >= (signed)menuitems.size()) return;
|
||||||
|
|
||||||
BasemenuItem *item = find(index);
|
BasemenuItem *item = find(index);
|
||||||
if (! item) return;
|
if (! item) return;
|
||||||
|
@ -805,8 +803,8 @@ void Basemenu::setItemEnabled(int index, Bool enable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bool Basemenu::isItemEnabled(int index) {
|
bool Basemenu::isItemEnabled(int index) {
|
||||||
if (index < 0 || index >= menuitems.size()) return False;
|
if (index < 0 || index >= (signed)menuitems.size()) return false;
|
||||||
|
|
||||||
BasemenuItem *item = find(index);
|
BasemenuItem *item = find(index);
|
||||||
if (! item) return False;
|
if (! item) return False;
|
||||||
|
@ -820,7 +818,7 @@ void Basemenu::buttonPressEvent(XButtonEvent *be) {
|
||||||
int sbl = (be->x / menu.item_w), i = (be->y / menu.item_h);
|
int sbl = (be->x / menu.item_w), i = (be->y / menu.item_h);
|
||||||
int w = (sbl * menu.persub) + i;
|
int w = (sbl * menu.persub) + i;
|
||||||
|
|
||||||
if (w < menuitems.size() && w >= 0) {
|
if (w < (signed)menuitems.size() && w >= 0) {
|
||||||
which_press = i;
|
which_press = i;
|
||||||
which_sbl = sbl;
|
which_sbl = sbl;
|
||||||
|
|
||||||
|
@ -862,7 +860,7 @@ void Basemenu::buttonReleaseEvent(XButtonEvent *re) {
|
||||||
w = (sbl * menu.persub) + i,
|
w = (sbl * menu.persub) + i,
|
||||||
p = (which_sbl * menu.persub) + which_press;
|
p = (which_sbl * menu.persub) + which_press;
|
||||||
|
|
||||||
if (w < menuitems.size() && w >= 0) {
|
if (w < (signed)menuitems.size() && w >= 0) {
|
||||||
drawItem(p, (p == which_sub), True);
|
drawItem(p, (p == which_sub), True);
|
||||||
|
|
||||||
if (p == w && isItemEnabled(w)) {
|
if (p == w && isItemEnabled(w)) {
|
||||||
|
@ -908,7 +906,7 @@ void Basemenu::motionNotifyEvent(XMotionEvent *me) {
|
||||||
w = (sbl * menu.persub) + i;
|
w = (sbl * menu.persub) + i;
|
||||||
|
|
||||||
if ((i != which_press || sbl != which_sbl) &&
|
if ((i != which_press || sbl != which_sbl) &&
|
||||||
(w < menuitems.size() && w >= 0)) {
|
(w < (signed)menuitems.size() && w >= 0)) {
|
||||||
if (which_press != -1 && which_sbl != -1) {
|
if (which_press != -1 && which_sbl != -1) {
|
||||||
int p = (which_sbl * menu.persub) + which_press;
|
int p = (which_sbl * menu.persub) + which_press;
|
||||||
BasemenuItem *item = menuitems[p];
|
BasemenuItem *item = menuitems[p];
|
||||||
|
|
|
@ -91,15 +91,14 @@ public:
|
||||||
int insert(const char *, Basemenu *, int = -1);
|
int insert(const char *, Basemenu *, int = -1);
|
||||||
int remove(int);
|
int remove(int);
|
||||||
|
|
||||||
inline const int &getX(void) const { return menu.x; }
|
inline int getX(void) const { return menu.x; }
|
||||||
inline const int &getY(void) const { return menu.y; }
|
inline int getY(void) const { return menu.y; }
|
||||||
inline int getCount(void) { return menuitems.size(); }
|
inline unsigned int getCount(void) { return menuitems.size(); }
|
||||||
inline const int &getCurrentSubmenu(void) const { return which_sub; }
|
inline int getCurrentSubmenu(void) const { return which_sub; }
|
||||||
|
|
||||||
inline const unsigned int &getWidth(void) const { return menu.width; }
|
inline unsigned int getWidth(void) const { return menu.width; }
|
||||||
inline const unsigned int &getHeight(void) const { return menu.height; }
|
inline unsigned int getHeight(void) const { return menu.height; }
|
||||||
inline const unsigned int &getTitleHeight(void) const
|
inline unsigned int getTitleHeight(void) const { return menu.title_h; }
|
||||||
{ return menu.title_h; }
|
|
||||||
|
|
||||||
inline void setInternalMenu(void) { internal_menu = True; }
|
inline void setInternalMenu(void) { internal_menu = True; }
|
||||||
inline void setAlignment(int a) { alignment = a; }
|
inline void setAlignment(int a) { alignment = a; }
|
||||||
|
@ -107,9 +106,9 @@ public:
|
||||||
inline void removeParent(void)
|
inline void removeParent(void)
|
||||||
{ if (internal_menu) parent = (Basemenu *) 0; }
|
{ if (internal_menu) parent = (Basemenu *) 0; }
|
||||||
|
|
||||||
Bool hasSubmenu(int);
|
bool hasSubmenu(int);
|
||||||
Bool isItemSelected(int);
|
bool isItemSelected(int);
|
||||||
Bool isItemEnabled(int);
|
bool isItemEnabled(int);
|
||||||
|
|
||||||
void buttonPressEvent(XButtonEvent *);
|
void buttonPressEvent(XButtonEvent *);
|
||||||
void buttonReleaseEvent(XButtonEvent *);
|
void buttonReleaseEvent(XButtonEvent *);
|
||||||
|
@ -121,8 +120,8 @@ public:
|
||||||
void setLabel(const char *n);
|
void setLabel(const char *n);
|
||||||
void move(int, int);
|
void move(int, int);
|
||||||
void update(void);
|
void update(void);
|
||||||
void setItemSelected(int, Bool);
|
void setItemSelected(int, bool);
|
||||||
void setItemEnabled(int, Bool);
|
void setItemEnabled(int, bool);
|
||||||
|
|
||||||
virtual void drawSubmenu(int);
|
virtual void drawSubmenu(int);
|
||||||
virtual void show(void);
|
virtual void show(void);
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
#include "Netizen.h"
|
#include "Netizen.h"
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
|
|
||||||
Netizen::Netizen(BScreen &scr, Window win) : screen(scr),
|
Netizen::Netizen(BScreen &scr, Window win) :basedisplay(scr.getBaseDisplay()),
|
||||||
basedisplay(scr.getBaseDisplay()), window(win)
|
screen(scr), window(win)
|
||||||
{
|
{
|
||||||
event.type = ClientMessage;
|
event.type = ClientMessage;
|
||||||
event.xclient.message_type = basedisplay.getOpenboxStructureMessagesAtom();
|
event.xclient.message_type = basedisplay.getOpenboxStructureMessagesAtom();
|
||||||
|
|
|
@ -55,8 +55,8 @@
|
||||||
#endif // MAXPATHLEN
|
#endif // MAXPATHLEN
|
||||||
|
|
||||||
|
|
||||||
Rootmenu::Rootmenu(BScreen &scrn) : Basemenu(scrn), screen(scrn),
|
Rootmenu::Rootmenu(BScreen &scrn) : Basemenu(scrn), openbox(scrn.getOpenbox()),
|
||||||
openbox(scrn.getOpenbox())
|
screen(scrn)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -583,7 +583,7 @@ Rect BScreen::availableArea() const {
|
||||||
#ifdef SLIT
|
#ifdef SLIT
|
||||||
int slit_x = slit->autoHide() ? slit->hiddenOrigin().x() : slit->area().x(),
|
int slit_x = slit->autoHide() ? slit->hiddenOrigin().x() : slit->area().x(),
|
||||||
slit_y = slit->autoHide() ? slit->hiddenOrigin().y() : slit->area().y();
|
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;
|
toolbar->getExposedHeight() + resource.border_width * 2;
|
||||||
bool tbartop;
|
bool tbartop;
|
||||||
switch (toolbar->placement()) {
|
switch (toolbar->placement()) {
|
||||||
|
@ -1836,7 +1836,7 @@ void BScreen::LoadStyle(void) {
|
||||||
|
|
||||||
// load bevel, border and handle widths
|
// load bevel, border and handle widths
|
||||||
if (conf.getValue("handleWidth", "HandleWidth", l)) {
|
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;
|
resource.handle_width = l;
|
||||||
else
|
else
|
||||||
resource.handle_width = 6;
|
resource.handle_width = 6;
|
||||||
|
@ -1849,7 +1849,7 @@ void BScreen::LoadStyle(void) {
|
||||||
resource.border_width = 1;
|
resource.border_width = 1;
|
||||||
|
|
||||||
if (conf.getValue("bevelWidth", "BevelWidth", l)) {
|
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;
|
resource.bevel_width = l;
|
||||||
else
|
else
|
||||||
resource.bevel_width = 3;
|
resource.bevel_width = 3;
|
||||||
|
@ -1857,7 +1857,7 @@ void BScreen::LoadStyle(void) {
|
||||||
resource.bevel_width = 3;
|
resource.bevel_width = 3;
|
||||||
|
|
||||||
if (conf.getValue("frameWidth", "FrameWidth", l)) {
|
if (conf.getValue("frameWidth", "FrameWidth", l)) {
|
||||||
if (l <= size().w() / 2)
|
if (l <= (signed)size().w() / 2)
|
||||||
resource.frame_width = l;
|
resource.frame_width = l;
|
||||||
else
|
else
|
||||||
resource.frame_width = resource.bevel_width;
|
resource.frame_width = resource.bevel_width;
|
||||||
|
@ -1912,7 +1912,7 @@ void BScreen::removeIcon(OpenboxWindow *w) {
|
||||||
|
|
||||||
|
|
||||||
OpenboxWindow *BScreen::getIcon(int index) {
|
OpenboxWindow *BScreen::getIcon(int index) {
|
||||||
if (index < 0 || index >= iconList.size())
|
if (index < 0 || index >= (signed)iconList.size())
|
||||||
return (OpenboxWindow *) 0;
|
return (OpenboxWindow *) 0;
|
||||||
|
|
||||||
winList::iterator it = iconList.begin();
|
winList::iterator it = iconList.begin();
|
||||||
|
@ -2021,7 +2021,6 @@ void BScreen::addNetizen(Netizen *n) {
|
||||||
|
|
||||||
void BScreen::removeNetizen(Window w) {
|
void BScreen::removeNetizen(Window w) {
|
||||||
netList::iterator it;
|
netList::iterator it;
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
for (it = netizenList.begin(); it != netizenList.end(); ++it)
|
for (it = netizenList.begin(); it != netizenList.end(); ++it)
|
||||||
if ((*it)->getWindowID() == w) {
|
if ((*it)->getWindowID() == w) {
|
||||||
|
@ -2147,7 +2146,7 @@ void BScreen::addWorkspaceName(const char *name) {
|
||||||
|
|
||||||
|
|
||||||
const char *BScreen::getNameOfWorkspace(int id) {
|
const char *BScreen::getNameOfWorkspace(int id) {
|
||||||
if (id < 0 || id >= workspaceNames.size())
|
if (id < 0 || id >= (signed)workspaceNames.size())
|
||||||
return (const char *) 0;
|
return (const char *) 0;
|
||||||
return workspaceNames[id].c_str();
|
return workspaceNames[id].c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ public:
|
||||||
|
|
||||||
Rect availableArea() const;
|
Rect availableArea() const;
|
||||||
|
|
||||||
inline Workspace *getWorkspace(int w) {
|
inline Workspace *getWorkspace(unsigned int w) {
|
||||||
ASSERT(w < workspacesList.size());
|
ASSERT(w < workspacesList.size());
|
||||||
return workspacesList[w];
|
return workspacesList[w];
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
using std::ends;
|
using std::ends;
|
||||||
|
|
||||||
Slit::Slit(BScreen &scr, Resource &conf) : screen(scr),
|
Slit::Slit(BScreen &scr, Resource &conf) : openbox(scr.getOpenbox()),
|
||||||
openbox(scr.getOpenbox()), config(conf)
|
screen(scr), config(conf)
|
||||||
{
|
{
|
||||||
load();
|
load();
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
using std::ends;
|
using std::ends;
|
||||||
|
|
||||||
Toolbar::Toolbar(BScreen &scrn, Resource &conf) : screen(scrn),
|
Toolbar::Toolbar(BScreen &scrn, Resource &conf) : openbox(scrn.getOpenbox()),
|
||||||
openbox(scrn.getOpenbox()), config(conf)
|
screen(scrn), config(conf)
|
||||||
{
|
{
|
||||||
load();
|
load();
|
||||||
|
|
||||||
|
|
|
@ -93,9 +93,9 @@ private:
|
||||||
} hide_handler;
|
} hide_handler;
|
||||||
|
|
||||||
Openbox &openbox;
|
Openbox &openbox;
|
||||||
|
BScreen &screen;
|
||||||
Resource &config;
|
Resource &config;
|
||||||
BImageControl *image_ctrl;
|
BImageControl *image_ctrl;
|
||||||
BScreen &screen;
|
|
||||||
BTimer *clock_timer, *hide_timer;
|
BTimer *clock_timer, *hide_timer;
|
||||||
Toolbarmenu *toolbarmenu;
|
Toolbarmenu *toolbarmenu;
|
||||||
|
|
||||||
|
|
|
@ -721,7 +721,7 @@ void OpenboxWindow::createMaximizeButton(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void OpenboxWindow::positionButtons(Bool redecorate_label) {
|
void OpenboxWindow::positionButtons() {
|
||||||
const char *format = openbox.getTitleBarLayout();
|
const char *format = openbox.getTitleBarLayout();
|
||||||
const unsigned int bw = frame.bevel_w + 1;
|
const unsigned int bw = frame.bevel_w + 1;
|
||||||
const unsigned int by = frame.bevel_w + 1;
|
const unsigned int by = frame.bevel_w + 1;
|
||||||
|
@ -785,23 +785,19 @@ void OpenboxWindow::positionButtons(Bool redecorate_label) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasclose) {
|
if (!hasclose && frame.close_button) {
|
||||||
openbox.removeWindowSearch(frame.close_button);
|
openbox.removeWindowSearch(frame.close_button);
|
||||||
XDestroyWindow(display, frame.close_button);
|
XDestroyWindow(display, frame.close_button);
|
||||||
frame.close_button = None;
|
|
||||||
}
|
}
|
||||||
if (!hasiconify) {
|
if (!hasiconify && frame.iconify_button) {
|
||||||
openbox.removeWindowSearch(frame.iconify_button);
|
openbox.removeWindowSearch(frame.iconify_button);
|
||||||
XDestroyWindow(display, frame.iconify_button);
|
XDestroyWindow(display, frame.iconify_button);
|
||||||
frame.iconify_button = None;
|
|
||||||
}
|
}
|
||||||
if (!hasmaximize) {
|
if (!hasmaximize && frame.iconify_button) {
|
||||||
openbox.removeWindowSearch(frame.maximize_button);
|
openbox.removeWindowSearch(frame.maximize_button);
|
||||||
XDestroyWindow(display, frame.maximize_button);
|
XDestroyWindow(display, frame.maximize_button);
|
||||||
frame.maximize_button = None;
|
|
||||||
}
|
}
|
||||||
if (redecorate_label)
|
|
||||||
decorateLabel();
|
|
||||||
redrawLabel();
|
redrawLabel();
|
||||||
redrawAllButtons();
|
redrawAllButtons();
|
||||||
}
|
}
|
||||||
|
@ -1302,10 +1298,9 @@ void OpenboxWindow::configure(int dx, int dy,
|
||||||
|
|
||||||
XMoveWindow(display, frame.window, frame.x, frame.y);
|
XMoveWindow(display, frame.window, frame.x, frame.y);
|
||||||
|
|
||||||
|
setFocusFlag(flags.focused);
|
||||||
positionWindows();
|
positionWindows();
|
||||||
decorate();
|
decorate();
|
||||||
setFocusFlag(flags.focused);
|
|
||||||
redrawAllButtons();
|
|
||||||
} else {
|
} else {
|
||||||
frame.x = dx;
|
frame.x = dx;
|
||||||
frame.y = dy;
|
frame.y = dy;
|
||||||
|
@ -1534,7 +1529,7 @@ void OpenboxWindow::maximize(unsigned int button) {
|
||||||
openbox_attrib.premax_x = openbox_attrib.premax_y = 0;
|
openbox_attrib.premax_x = openbox_attrib.premax_y = 0;
|
||||||
openbox_attrib.premax_w = openbox_attrib.premax_h = 0;
|
openbox_attrib.premax_w = openbox_attrib.premax_h = 0;
|
||||||
|
|
||||||
redrawAllButtons();
|
redrawMaximizeButton(flags.maximized);
|
||||||
setState(current_state);
|
setState(current_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1608,7 +1603,7 @@ void OpenboxWindow::maximize(unsigned int button) {
|
||||||
|
|
||||||
configure(dx, dy, dw, dh);
|
configure(dx, dy, dw, dh);
|
||||||
screen->getWorkspace(workspace_number)->raiseWindow(this);
|
screen->getWorkspace(workspace_number)->raiseWindow(this);
|
||||||
redrawAllButtons();
|
redrawMaximizeButton(flags.maximized);
|
||||||
setState(current_state);
|
setState(current_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2241,12 +2236,8 @@ void OpenboxWindow::mapNotifyEvent(XMapEvent *ne) {
|
||||||
openbox.grab();
|
openbox.grab();
|
||||||
if (! validateClient()) return;
|
if (! validateClient()) return;
|
||||||
|
|
||||||
if (decorations.titlebar) positionButtons();
|
|
||||||
|
|
||||||
setState(NormalState);
|
setState(NormalState);
|
||||||
|
|
||||||
redrawAllButtons();
|
|
||||||
|
|
||||||
if (flags.transient || screen->focusNew())
|
if (flags.transient || screen->focusNew())
|
||||||
setInputFocus();
|
setInputFocus();
|
||||||
else
|
else
|
||||||
|
@ -2410,7 +2401,10 @@ void OpenboxWindow::propertyNotifyEvent(Atom atom) {
|
||||||
|
|
||||||
if (decorations.close && (! frame.close_button)) {
|
if (decorations.close && (! frame.close_button)) {
|
||||||
createCloseButton();
|
createCloseButton();
|
||||||
if (decorations.titlebar) positionButtons(True);
|
if (decorations.titlebar) {
|
||||||
|
positionButtons();
|
||||||
|
decorateLabel();
|
||||||
|
}
|
||||||
if (windowmenu) windowmenu->reconfigure();
|
if (windowmenu) windowmenu->reconfigure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ protected:
|
||||||
void associateClientWindow();
|
void associateClientWindow();
|
||||||
void decorate();
|
void decorate();
|
||||||
void decorateLabel();
|
void decorateLabel();
|
||||||
void positionButtons(Bool redecorate_label = False);
|
void positionButtons();
|
||||||
void positionWindows();
|
void positionWindows();
|
||||||
void createCloseButton();
|
void createCloseButton();
|
||||||
void createIconifyButton();
|
void createIconifyButton();
|
||||||
|
|
|
@ -81,7 +81,7 @@ Workspace::~Workspace(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const int Workspace::addWindow(OpenboxWindow *w, Bool place) {
|
int Workspace::addWindow(OpenboxWindow *w, bool place) {
|
||||||
if (! w) return -1;
|
if (! w) return -1;
|
||||||
|
|
||||||
if (place) placeWindow(*w);
|
if (place) placeWindow(*w);
|
||||||
|
@ -103,7 +103,7 @@ const int Workspace::addWindow(OpenboxWindow *w, Bool place) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const int Workspace::removeWindow(OpenboxWindow *w) {
|
int Workspace::removeWindow(OpenboxWindow *w) {
|
||||||
if (! w) return -1;
|
if (! w) return -1;
|
||||||
|
|
||||||
_zorder.remove(w);
|
_zorder.remove(w);
|
||||||
|
@ -190,7 +190,7 @@ void Workspace::raiseWindow(OpenboxWindow *w) {
|
||||||
Workspace *wkspc;
|
Workspace *wkspc;
|
||||||
|
|
||||||
win = bottom;
|
win = bottom;
|
||||||
while (True) {
|
while (true) {
|
||||||
*(curr++) = win->getFrameWindow();
|
*(curr++) = win->getFrameWindow();
|
||||||
screen.updateNetizenWindowRaise(win->getClientWindow());
|
screen.updateNetizenWindowRaise(win->getClientWindow());
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ void Workspace::lowerWindow(OpenboxWindow *w) {
|
||||||
Window *nstack = new Window[i], *curr = nstack;
|
Window *nstack = new Window[i], *curr = nstack;
|
||||||
Workspace *wkspc;
|
Workspace *wkspc;
|
||||||
|
|
||||||
while (True) {
|
while (true) {
|
||||||
*(curr++) = win->getFrameWindow();
|
*(curr++) = win->getFrameWindow();
|
||||||
screen.updateNetizenWindowLower(win->getClientWindow());
|
screen.updateNetizenWindowLower(win->getClientWindow());
|
||||||
|
|
||||||
|
@ -267,25 +267,25 @@ void Workspace::reconfigure(void) {
|
||||||
|
|
||||||
|
|
||||||
OpenboxWindow *Workspace::getWindow(int index) {
|
OpenboxWindow *Workspace::getWindow(int index) {
|
||||||
if ((index >= 0) && (index < _windows.size()))
|
if ((index >= 0) && (index < (signed)_windows.size()))
|
||||||
return _windows[index];
|
return _windows[index];
|
||||||
else
|
else
|
||||||
return (OpenboxWindow *) 0;
|
return (OpenboxWindow *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const int Workspace::getCount(void) {
|
int Workspace::getCount(void) {
|
||||||
return _windows.size();
|
return (signed)_windows.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Workspace::update(void) {
|
void Workspace::update(void) {
|
||||||
clientmenu->update();
|
clientmenu->update();
|
||||||
screen.getToolbar()->redrawWindowLabel(True);
|
screen.getToolbar()->redrawWindowLabel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bool Workspace::isCurrent(void) {
|
bool Workspace::isCurrent(void) {
|
||||||
return (id == screen.getCurrentWorkspaceID());
|
return (id == screen.getCurrentWorkspaceID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,15 +68,15 @@ public:
|
||||||
inline BScreen &getScreen(void) { return screen; }
|
inline BScreen &getScreen(void) { return screen; }
|
||||||
inline Clientmenu *getMenu(void) { return clientmenu; }
|
inline Clientmenu *getMenu(void) { return clientmenu; }
|
||||||
inline const char *getName(void) const { return name; }
|
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 *focusedWindow() { return _focused; }
|
||||||
inline OpenboxWindow *lastFocusedWindow() { return _last; }
|
inline OpenboxWindow *lastFocusedWindow() { return _last; }
|
||||||
void focusWindow(OpenboxWindow *win);
|
void focusWindow(OpenboxWindow *win);
|
||||||
OpenboxWindow *getWindow(int);
|
OpenboxWindow *getWindow(int);
|
||||||
Bool isCurrent(void);
|
bool isCurrent(void);
|
||||||
const int addWindow(OpenboxWindow *, Bool = False);
|
int addWindow(OpenboxWindow *, bool = false);
|
||||||
const int removeWindow(OpenboxWindow *);
|
int removeWindow(OpenboxWindow *);
|
||||||
const int getCount(void);
|
int getCount(void);
|
||||||
void showAll(void);
|
void showAll(void);
|
||||||
void hideAll(void);
|
void hideAll(void);
|
||||||
void removeAll(void);
|
void removeAll(void);
|
||||||
|
|
Loading…
Reference in a new issue