From 38654bae459716409ad2ee7975671fc2f131c869 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sat, 16 Aug 2008 05:54:07 -0700 Subject: some cleanup --- src/Ewmh.cc | 2 +- src/FbTk/Container.cc | 11 +++--- src/FbTk/FbDrawable.cc | 8 ---- src/FbTk/FbDrawable.hh | 4 -- src/FbTk/FbWindow.cc | 9 +---- src/FbTk/FbWindow.hh | 5 +-- src/FbTk/GContext.hh | 14 +------ src/FbTk/Layer.hh | 79 --------------------------------------- src/FbTk/LayerItem.hh | 5 --- src/FbTk/Menu.cc | 2 +- src/FbTk/Menu.hh | 9 +---- src/FbTk/RefCount.hh | 5 +-- src/FbTk/SignalHandler.cc | 7 ---- src/FbTk/SignalHandler.hh | 8 +--- src/FbTk/TextButton.cc | 16 -------- src/FbTk/TextButton.hh | 10 ----- src/FbTk/Texture.cc | 3 +- src/FbTk/XLayer.cc | 94 ----------------------------------------------- src/FbTk/XLayer.hh | 9 ----- src/FbTk/XLayerItem.cc | 10 ----- src/FbTk/XLayerItem.hh | 6 --- src/FbWinFrame.cc | 12 +++--- src/Remember.cc | 8 ++-- src/Window.cc | 30 +++++++-------- 24 files changed, 42 insertions(+), 324 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 5db7478..8938e7d 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -1251,7 +1251,7 @@ void Ewmh::toggleState(FluxboxWindow &win, Atom state) { void Ewmh::setState(FluxboxWindow &win, Atom state, bool value, WinClient &client) { if (state == m_net->wm_state_sticky) { // STICKY - if (value && !win.isStuck() || + if ((value && !win.isStuck()) || (!value && win.isStuck())) win.stick(); } else if (state == m_net->wm_state_shaded) { // SHADED diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc index 8175829..381f13f 100644 --- a/src/FbTk/Container.cc +++ b/src/FbTk/Container.cc @@ -332,7 +332,8 @@ void Container::repositionItems() { // calling Container::resize here risks infinite loops unsigned int neww = total_width, newh = height; translateSize(m_orientation, neww, newh); - if (align == RIGHT && m_orientation != ROT270 || align == LEFT && m_orientation == ROT270) { + if ((align == RIGHT && m_orientation != ROT270) || + (align == LEFT && m_orientation == ROT270)) { int deltax = 0; int deltay = 0; if (m_orientation == ROT0 || m_orientation == ROT180) @@ -477,10 +478,10 @@ void Container::setOrientation(Orientation orient) { for (; it != it_end; ++it) (*it)->setOrientation(orient); - if ((m_orientation == ROT0 || m_orientation == ROT180) && - (orient == ROT90 || orient == ROT270) || - (m_orientation == ROT90 || m_orientation == ROT270) && - (orient == ROT0 || orient == ROT180)) { + if (((m_orientation == ROT0 || m_orientation == ROT180) && + (orient == ROT90 || orient == ROT270)) || + ((m_orientation == ROT90 || m_orientation == ROT270) && + (orient == ROT0 || orient == ROT180))) { // flip width and height m_orientation = orient; resize(height(), width()); diff --git a/src/FbTk/FbDrawable.cc b/src/FbTk/FbDrawable.cc index 766dd56..3579268 100644 --- a/src/FbTk/FbDrawable.cc +++ b/src/FbTk/FbDrawable.cc @@ -151,14 +151,6 @@ void FbDrawable::drawTriangle(GC gc, FbDrawable::TriangleType type, Convex, CoordModePrevious); } -#ifdef NOT_USED -void FbDrawable::drawPoint(GC gc, int x, int y) { - if (drawable() == 0 || gc == 0) - return; - XDrawPoint(display(), drawable(), gc, x, y); -} -#endif - XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const { return XGetImage(display(), drawable(), x, y, width, height, diff --git a/src/FbTk/FbDrawable.hh b/src/FbTk/FbDrawable.hh index e98c732..9add5a0 100644 --- a/src/FbTk/FbDrawable.hh +++ b/src/FbTk/FbDrawable.hh @@ -61,10 +61,6 @@ public: virtual void drawTriangle(GC gc, TriangleType type, int x, int y, unsigned int width, unsigned int height, int scale); -#ifdef NOT_USED - virtual void drawPoint(GC gc, int x, int y); -#endif - virtual XImage *image(int x, int y, unsigned int width, unsigned int height) const; /// X drawable diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index fb68eb9..56f354b 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc @@ -283,7 +283,8 @@ void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, u if (width() == 0 || height() == 0) return; - if (!dest_override && (the_width == 0 && the_height == 0 || the_width == width() && the_height == height()) && + if (!dest_override && ((the_width == 0 && the_height == 0) || + (the_width == width() && the_height == height())) && the_x <= 0 && the_y <= 0) { // do the whole thing updateBackground(true); @@ -453,12 +454,6 @@ void FbWindow::setCursor(Cursor cur) { XDefineCursor(display(), window(), cur); } -#ifdef NOT_USED -void FbWindow::unsetCursor() { - XUndefineCursor(display(), window()); -} -#endif - void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) { XReparentWindow(display(), window(), parent.window(), x, y); m_parent = &parent; diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index f212e50..a80a5b0 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh @@ -137,10 +137,7 @@ public: void setInputFocus(int revert_to, int time); /// defines a cursor for this window void setCursor(Cursor cur); -#ifdef NOT_USED - /// uses the parents cursor instead - void unsetCursor(); -#endif + void reparent(const FbWindow &parent, int x, int y, bool continuing = true); bool property(Atom property, diff --git a/src/FbTk/GContext.hh b/src/FbTk/GContext.hh index 7fd16d4..e100bb6 100644 --- a/src/FbTk/GContext.hh +++ b/src/FbTk/GContext.hh @@ -89,15 +89,7 @@ public: void setFont(int fid) { XSetFont(m_display, m_gc, fid); } -#ifdef NOT_USED - void setClipMask(const FbTk::FbPixmap &mask) { - XSetClipMask(m_display, m_gc, mask.drawable()); - } - void setClipOrigin(int x, int y) { - XSetClipOrigin(m_display, m_gc, x, y); - } -#endif void setGraphicsExposure(bool value) { XSetGraphicsExposures(m_display, m_gc, value); } @@ -112,11 +104,7 @@ public: void setFillStyle(int style) { XSetFillStyle(m_display, m_gc, style); } -#ifdef NOT_USED - void setFillRule(int rule) { - XSetFillRule(m_display, m_gc, rule); - } -#endif + void setLineAttributes(unsigned int width, int line_style, int cap_style, diff --git a/src/FbTk/Layer.hh b/src/FbTk/Layer.hh index 954449d..405285c 100644 --- a/src/FbTk/Layer.hh +++ b/src/FbTk/Layer.hh @@ -39,22 +39,10 @@ public: virtual iterator insert(ItemType &item, unsigned int pos=0); /// remove item from list virtual void remove(ItemType &item); -#ifdef NOT_USED - /// cycle all item upwards - virtual void cycleUp(); - /// cycle all items downwards - virtual void cycleDown(); -#endif // NOT_USED /// move item to top virtual void raise(ItemType &item); /// move item to bottom virtual void lower(ItemType &item); -#ifdef NOT_USED - /// raise a specific item one step - virtual void stepUp(ItemType &item); - /// lower a specific item one step - virtual void stepDown(ItemType &item); -#endif // NOT_USED virtual void restack(); /// @return layer item on specific position, on failure 0 ItemType *getItem(unsigned int position); @@ -95,73 +83,6 @@ void Layer::remove(ItemType &item) { m_list.erase(it); } -#ifdef NOT_USED -template -void Layer::cycleUp() { - if (size() == 0) - return; - iterator it = itemList().begin(); - it++; - rotate(itemList().begin(), it, itemList().end()); - restack(); -} - - -template -void Layer::cycleDown() { - if (size() == 0) - return; - // save last item and remove it from list - ItemType *last_item = itemList().back(); - itemList().pop_back(); - // add last item to front - itemList().insert(itemList().begin(), last_item); - restack(); -} - -template -void Layer::stepUp(ItemType &item) { - iterator it = - find(itemList().begin(), itemList().end(), &item); - - if (it == itemList().end()) - return; - - if (it == itemList().begin()) // we can't raise it more - return; - - iterator new_pos = it; - new_pos--; - ItemType *textitem = *it; - // remove item from list - itemList().erase(it); - // insert above last pos - itemList().insert(new_pos, textitem); - restack(); -} - -template -void Layer::stepDown(ItemType &item) { - iterator it = - find(itemList().begin(), itemList().end(), &item); - - if (it == itemList().end()) // we didn't find the item in our list - return; - - if (*it == itemList().back()) // it's already at the bottom - return; - - iterator new_pos = it; - new_pos++; - ItemType *textitem = *it; - // remove from list - itemList().erase(it); - // insert on the new place - itemList().insert(new_pos, textitem); - restack(); -} -#endif // NOT_USED - template void Layer::raise(ItemType &item) { if (&item == itemList().front()) // already at the bottom diff --git a/src/FbTk/LayerItem.hh b/src/FbTk/LayerItem.hh index 981d9f5..945bb9a 100644 --- a/src/FbTk/LayerItem.hh +++ b/src/FbTk/LayerItem.hh @@ -32,11 +32,6 @@ public: virtual void raise() = 0; virtual void lower() = 0; - -#ifdef NOT_USED - virtual void stepUp() = 0; - virtual void stepDown() = 0; -#endif // NOT_USED }; } // end namespace FbTk diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index ec60b24..4bdc597 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -1136,7 +1136,7 @@ void Menu::openSubmenu() { int item = m_active_index; if (!isVisible() || !validIndex(item) || !menuitems[item]->isEnabled() || - s_focused != this && s_focused && s_focused->isVisible()) + (s_focused != this && s_focused && s_focused->isVisible())) return; clearItem(item); diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 2675502..ee57a23 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh @@ -76,10 +76,7 @@ public: void removeAll(); void setInternalMenu(bool val = true) { m_internal_menu = val; } void setAlignment(Alignment a) { m_alignment = a; } -#ifdef NOT_USED - void setTorn() { m_torn = true; } - void removeParent() { if (m_internal_menu) m_parent = 0; } -#endif + /// raise this window virtual void raise(); /// lower this window @@ -122,16 +119,12 @@ public: /// hide menu virtual void hide(bool force = false); virtual void clearWindow(); -#ifdef NOT_USED - void setActiveIndex(int index) { m_active_index = index; } /*@}*/ /** @name accessors */ //@{ - int activeIndex() const { return m_active_index; } -#endif bool isTorn() const { return m_torn; } bool isVisible() const { return m_visible; } bool isMoving() const { return m_moving; } diff --git a/src/FbTk/RefCount.hh b/src/FbTk/RefCount.hh index adeebf0..6d1b9b7 100644 --- a/src/FbTk/RefCount.hh +++ b/src/FbTk/RefCount.hh @@ -38,10 +38,7 @@ public: Pointer *operator * () const { return get(); } Pointer *operator -> () const { return get(); } Pointer *get() const { return m_data; } -#ifdef NOT_USED - /// @return number of references - unsigned int usedBy() const { return (m_refcount != 0 ? *m_refcount : 0); } -#endif + private: /// increase reference count void incRefCount(); diff --git a/src/FbTk/SignalHandler.cc b/src/FbTk/SignalHandler.cc index c7a4fa7..ea0f86f 100644 --- a/src/FbTk/SignalHandler.cc +++ b/src/FbTk/SignalHandler.cc @@ -60,13 +60,6 @@ bool SignalHandler::registerHandler(int signum, SignalEventHandler *eh, return true; } -#ifdef NOT_USED -void SignalHandler::removeHandler(int signum) { - if (signum < NSIG) - s_signal_handler[signum] = 0; // clear handler pointer -} -#endif - void SignalHandler::handleSignal(int signum) { if (signum >= NSIG) return; diff --git a/src/FbTk/SignalHandler.hh b/src/FbTk/SignalHandler.hh index 9c8e680..774f4b1 100644 --- a/src/FbTk/SignalHandler.hh +++ b/src/FbTk/SignalHandler.hh @@ -52,13 +52,7 @@ public: @param oldhandler_ret return handler to old sighandler */ bool registerHandler(int signum, SignalEventHandler *eh, SignalEventHandler **oldhandler_ret = 0); -#ifdef NOT_USED - /** - removes the signum handler - @param signum signal number - */ - void removeHandler(int signum); -#endif + private: SignalHandler(); diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc index f259d89..79ed1ab 100644 --- a/src/FbTk/TextButton.cc +++ b/src/FbTk/TextButton.cc @@ -97,15 +97,6 @@ void TextButton::setFont(FbTk::Font &font) { font.validOrientation(m_orientation); // load the orientation! } -#ifdef NOT_USED -/// set bevel and redraw text -void TextButton::setBevel(int bevel) { - if (m_bevel == bevel) - return; - m_bevel = bevel; -} -#endif - void TextButton::setTextPaddingLeft(unsigned int leftpadding) { m_left_padding = leftpadding; } @@ -138,13 +129,6 @@ unsigned int TextButton::textWidth() const { return font().textWidth(text().data(), text().size()); } -#ifdef NOT_USED -unsigned int TextButton::textHeight() const { - return font().height(); - -} -#endif - void TextButton::renderForeground(FbWindow &win, FbDrawable &drawable) { // (win should always be *this, no need to check) drawText(0, 0, &drawable); diff --git a/src/FbTk/TextButton.hh b/src/FbTk/TextButton.hh index 22cda82..6ddcd8f 100644 --- a/src/FbTk/TextButton.hh +++ b/src/FbTk/TextButton.hh @@ -40,9 +40,6 @@ public: bool setOrientation(FbTk::Orientation orient); void setText(const std::string &text); void setFont(FbTk::Font &font); -#ifdef NOT_USED - void setBevel(int bevel); -#endif void setTextPadding(unsigned int padding); void setTextPaddingLeft(unsigned int leftpadding); void setTextPaddingRight(unsigned int rightpadding); @@ -67,14 +64,7 @@ public: FbTk::Font &font() const { return *m_font; } FbTk::Orientation orientation() const { return m_orientation; } unsigned int textWidth() const; -#ifdef NOT_USED - unsigned int textHeight() const; -#endif int bevel() const { return m_bevel; } -#ifdef NOT_USED - unsigned int leftPadding() const { return m_left_padding; } - unsigned int rightPadding() const { return m_right_padding; } -#endif void renderForeground(FbWindow &win, FbDrawable &drawable); diff --git a/src/FbTk/Texture.cc b/src/FbTk/Texture.cc index 5a12e8d..2fcd915 100644 --- a/src/FbTk/Texture.cc +++ b/src/FbTk/Texture.cc @@ -89,11 +89,12 @@ void Texture::setFromString(const char * const texture_str) { else addType(Texture::DEFAULT_BEVEL); - if (! (type() & Texture::FLAT)) + if (! (type() & Texture::FLAT)) { if (strstr(ts, "bevel2")) addType(Texture::BEVEL2); else addType(Texture::BEVEL1); + } if (strstr(ts, "invert")) addType(Texture::INVERT); diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc index 51a0fe0..0d878d3 100644 --- a/src/FbTk/XLayer.cc +++ b/src/FbTk/XLayer.cc @@ -174,100 +174,6 @@ void XLayer::remove(XLayerItem &item) { } } -#ifdef NOT_USED -void XLayer::cycleUp() { - // need to find highest visible window, and move it to bottom - iterator it = itemList().begin(); - iterator it_end = itemList().end(); - while (it != it_end && !(*it)->visible()) - ++it; - - // if there is something to do - if (it != it_end) - lower(**it); - -} - -void XLayer::cycleDown() { - // need to find lowest visible window, and move it to top - // so use a reverse iterator, and the same logic as cycleUp() - reverse_iterator it = itemList().rbegin(); - reverse_iterator it_end = itemList().rend(); - while (it != it_end && !(*it)->visible()) - ++it; - - // if there is something to do - if (it != it_end) - raise(**it); - -} - -void XLayer::stepUp(XLayerItem &item) { - // need to find next visible window upwards, and put it above that - - if (&item == itemList().front()) - return; // nothing to do - - // TODO: is there a better way of doing this? - - // get our item - iterator myit = find(itemList().begin(), itemList().end(), &item); - iterator it = myit; - - // go to the one above it in our layer (top is front, so we decrement) - --it; - - // keep going until we find one that is currently visible to the user - while (it != itemList().begin() && !(*it)->visible()) - --it; - - if (it == itemList().begin() && !(*it)->visible()) { - // reached front item, but it wasn't visible, therefore it was already raised - } else { - // it is the next visible item down, we need to be above it. - // remove that item from the list and add it back to before it (the one we want to go above) - - itemList().erase(myit); - itemList().insert(it, &item); - - // if we've reached the top of the layer, we need to stack below the next one up - if (it == itemList().begin()) { - stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); - } else { - // otherwise go up one in this layer (i.e. above the one we want to go above) - --it; - // and stack below that. - stackBelowItem(&item, *it); - } - } -} - -void XLayer::stepDown(XLayerItem &item) { - // need to find next visible window down, and put it below that - - // if we're already the bottom of the layer - if (&item == itemList().back()) - return; // nothing to do - - // get our position - iterator it = find(itemList().begin(), itemList().end(), &item); - - // go one below it (top is front, so we must increment) - it++; - iterator it_end = itemList().end(); - - // keep going down until we find a visible one - while (it != it_end && !(*it)->visible()) - it++; - - // if we didn't reach the end, then stack below the - // item that we found. - if (it != it_end) - stackBelowItem(&item, *it); - // if we did reach the end, then there are no visible windows, so we don't do anything -} -#endif // NOT_USED - void XLayer::raise(XLayerItem &item) { // assume it is already in this layer diff --git a/src/FbTk/XLayer.hh b/src/FbTk/XLayer.hh index b9e34da..acc299c 100644 --- a/src/FbTk/XLayer.hh +++ b/src/FbTk/XLayer.hh @@ -60,15 +60,6 @@ public: iterator insert(XLayerItem &item, unsigned int pos=0); void remove(XLayerItem &item); -#ifdef NOT_USED - // move highest to bottom - void cycleUp(); - void cycleDown(); - // just go above the next window up in the current layer (not all the way to the top) - void stepUp(XLayerItem &item); - void stepDown(XLayerItem &item); -#endif // NOT_USED - // bring to top of layer void raise(XLayerItem &item); void lower(XLayerItem &item); diff --git a/src/FbTk/XLayerItem.cc b/src/FbTk/XLayerItem.cc index c4e0393..d822590 100644 --- a/src/FbTk/XLayerItem.cc +++ b/src/FbTk/XLayerItem.cc @@ -58,16 +58,6 @@ void XLayerItem::tempRaise() { m_layer->tempRaise(*this); } -#ifdef NOT_USED -void XLayerItem::stepUp() { - m_layer->stepUp(*this); -} - -void XLayerItem::stepDown() { - m_layer->stepDown(*this); -} -#endif // NOT_USED - void XLayerItem::raiseLayer() { m_layer->raiseLayer(*this); } diff --git a/src/FbTk/XLayerItem.hh b/src/FbTk/XLayerItem.hh index 6548665..8f9aebe 100644 --- a/src/FbTk/XLayerItem.hh +++ b/src/FbTk/XLayerItem.hh @@ -44,12 +44,6 @@ public: void lower(); void tempRaise(); // this raise gets reverted by a restack() -#ifdef NOT_USED - // go above the next item visible in this layer - void stepUp(); - void stepDown(); -#endif // NOT_USED - // send to next layer up void raiseLayer(); void lowerLayer(); diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index c7eaef3..d0d1e21 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -247,8 +247,8 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh if (move && x == window().x() && y == window().y()) move = false; - if (resize && (m_state.shaded || width == FbWinFrame::width() && - height == FbWinFrame::height())) + if (resize && (m_state.shaded || (width == FbWinFrame::width() && + height == FbWinFrame::height()))) resize = false; if (!move && !resize) @@ -265,7 +265,7 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh m_window.resize(width, height); } - if (move || resize && m_screen.getTabPlacement() != TOPLEFT) + if (move || (resize && m_screen.getTabPlacement() != TOPLEFT)) alignTabs(); if (resize) { @@ -413,7 +413,7 @@ void FbWinFrame::notifyMoved(bool clear) { if (alpha == 255) return; - if (m_tabmode == EXTERNAL && m_use_tabs || m_use_titlebar) { + if ((m_tabmode == EXTERNAL && m_use_tabs) || m_use_titlebar) { m_tab_container.parentMoved(); m_tab_container.for_each(mem_fun(&FbTk::Button::parentMoved)); } @@ -1430,8 +1430,8 @@ int FbWinFrame::getDecoMaskFromString(const string &str_label) { if (label == "tab") return DECOR_TAB; int mask = -1; - if (str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x' || - str_label.size() > 0 && isdigit(str_label[0])) + if ((str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x') || + (str_label.size() > 0 && isdigit(str_label[0]))) mask = strtol(str_label.c_str(), NULL, 0); return mask; } diff --git a/src/Remember.cc b/src/Remember.cc index fc5d9b6..3e9e16a 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -1310,8 +1310,8 @@ void Remember::setupFrame(FluxboxWindow &win) { if (app->shadedstate_remember) // if inconsistent... - if (win.isShaded() && !app->shadedstate || - !win.isShaded() && app->shadedstate) + if ((win.isShaded() && !app->shadedstate) || + (!win.isShaded() && app->shadedstate)) win.shade(); // toggles // external tabs aren't available atm... @@ -1319,8 +1319,8 @@ void Remember::setupFrame(FluxboxWindow &win) { if (app->stuckstate_remember) // if inconsistent... - if (win.isStuck() && !app->stuckstate || - !win.isStuck() && app->stuckstate) + if ((win.isStuck() && !app->stuckstate) || + (!win.isStuck() && app->stuckstate)) win.stick(); // toggles if (app->minimizedstate_remember) { diff --git a/src/Window.cc b/src/Window.cc index 43dc311..269665e 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -1277,9 +1277,9 @@ void FluxboxWindow::getMaxSize(unsigned int* width, unsigned int* height) const for (; it != it_end; ++it) { // special case for max height/width == 0 // 0 indicates unlimited size, so we skip them - if (h || (*it)->maxHeight() && h > (*it)->maxHeight()) + if (!h || ((*it)->maxHeight() && h > (*it)->maxHeight())) h = (*it)->maxHeight(); - if (!w || (*it)->maxWidth() && w > (*it)->maxWidth()) + if (!w || ((*it)->maxWidth() && w > (*it)->maxWidth())) w = (*it)->maxWidth(); } @@ -1876,7 +1876,7 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) { if (!m_initialized) m_layernum = layernum; - if (m_layernum == layernum && !force || !m_client) + if ((m_layernum == layernum && !force) || !m_client) return; // get root window @@ -2475,9 +2475,9 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { } // don't allow moving/resizing fullscreen or maximized windows - if (isFullscreen() || isMaximizedHorz() && screen().getMaxIgnoreIncrement()) + if (isFullscreen() || (isMaximizedHorz() && screen().getMaxIgnoreIncrement())) cr.value_mask = cr.value_mask & ~(CWWidth | CWX); - if (isFullscreen() || isMaximizedVert() && screen().getMaxIgnoreIncrement()) + if (isFullscreen() || (isMaximizedVert() && screen().getMaxIgnoreIncrement())) cr.value_mask = cr.value_mask & ~(CWHeight | CWY); #ifdef REMEMBER @@ -2545,7 +2545,7 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { case Above: case TopIf: default: - if (isFocused() && focusRequestFromClient(*client) || + if ((isFocused() && focusRequestFromClient(*client)) || !FocusControl::focusedWindow()) { setCurrentClient(*client, true); raise(); @@ -2618,8 +2618,8 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) { // check keys file first Keys *k = Fluxbox::instance()->keys(); - if (onTitlebar && k->doAction(be.type, be.state, be.button, - Keys::ON_TITLEBAR, m_client, be.time) || + if ((onTitlebar && k->doAction(be.type, be.state, be.button, + Keys::ON_TITLEBAR, m_client, be.time)) || k->doAction(be.type, be.state, be.button, Keys::ON_WINDOW, m_client, be.time)) { return; @@ -2706,8 +2706,8 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { return; } - if (moving || (me.state & Button1Mask) && functions.move && - inside_titlebar && !isResizing() && m_attaching_tab == 0) { + if (moving || ((me.state & Button1Mask) && functions.move && + inside_titlebar && !isResizing() && m_attaching_tab == 0)) { if (! isMoving()) { startMoving(me.x_root, me.y_root); @@ -2781,11 +2781,11 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { screen().showPosition(dx, dy); } // end if moving - } else if (resizing || m_attaching_tab == 0 && functions.resize && - (((me.state & Button1Mask) && - (me.window == frame().gripRight() || - me.window == frame().gripLeft())) || - me.window == frame().window())) { + } else if (resizing || (m_attaching_tab == 0 && functions.resize && + (((me.state & Button1Mask) && + (me.window == frame().gripRight() || + me.window == frame().gripLeft())) || + me.window == frame().window()))) { if (! resizing) { -- cgit v0.11.2