From 1d8dfcdf9ad5405f4eef18dc009ce8cfe6d27f29 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Fri, 15 Aug 2008 19:38:41 +0200 Subject: cosmetic api change --- src/Ewmh.cc | 2 +- src/Window.cc | 27 +++++++++++++++++++++------ src/Window.hh | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 3453b7e..5db7478 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -1389,7 +1389,7 @@ void Ewmh::updateActions(FluxboxWindow &win) { actions.push_back(m_net->wm_action_minimize); unsigned int max_width, max_height; - win.maxSize(max_width, max_height); + win.getMaxSize(&max_width, &max_height); // if unlimited max width we can maximize horizontal if (max_width == 0) { diff --git a/src/Window.cc b/src/Window.cc index cf9fa81..43dc311 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -1261,18 +1261,33 @@ void FluxboxWindow::moveResizeForClient(int new_x, int new_y, } -void FluxboxWindow::maxSize(unsigned int &width, unsigned int &height) const { +void FluxboxWindow::getMaxSize(unsigned int* width, unsigned int* height) const { + + if (!width || !height) + return; + ClientList::const_iterator it = clientList().begin(); ClientList::const_iterator it_end = clientList().end(); - width = height = 0; // unlimited + + unsigned int w; + unsigned int h; + + w = h = 0; // unlimited + for (; it != it_end; ++it) { // special case for max height/width == 0 // 0 indicates unlimited size, so we skip them - if (!height || (*it)->maxHeight() && height > (*it)->maxHeight()) - height = (*it)->maxHeight(); - if (!width || (*it)->maxWidth() && width > (*it)->maxWidth()) - width = (*it)->maxWidth(); + if (h || (*it)->maxHeight() && h > (*it)->maxHeight()) + h = (*it)->maxHeight(); + if (!w || (*it)->maxWidth() && w > (*it)->maxWidth()) + w = (*it)->maxWidth(); } + + if (width) + *width = w; + + if (height) + *height = h; } // returns whether the focus was "set" to this window diff --git a/src/Window.hh b/src/Window.hh index 3c26530..d533dfc 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -305,7 +305,7 @@ public: * @param width will be filled in with maximum width * @param height will be filled in with maximum height */ - void maxSize(unsigned int &width, unsigned int &height) const; + void getMaxSize(unsigned int* width, unsigned int* height) const; void setWorkspace(int n); void updateFunctions(); void restoreAttributes(); -- cgit v0.11.2