all repos — fluxbox @ 1d8dfcdf9ad5405f4eef18dc009ce8cfe6d27f29

custom fork of the fluxbox windowmanager

cosmetic api change
Mathias Gumz akira at fluxbox dot org
commit

1d8dfcdf9ad5405f4eef18dc009ce8cfe6d27f29

parent

1056474e1d2b6a437051a9ef6eb450df599998c8

3 files changed, 23 insertions(+), 8 deletions(-)

jump to
M src/Ewmh.ccsrc/Ewmh.cc

@@ -1389,7 +1389,7 @@ if (win.isIconifiable())

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) {
M src/Window.ccsrc/Window.cc

@@ -1261,18 +1261,33 @@ }

} -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
M src/Window.hhsrc/Window.hh

@@ -305,7 +305,7 @@ * Determines maximum size using all clients that this window can have.

* @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();