aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-15 11:39:24 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-15 11:39:24 (GMT)
commit06d696f99b276e3394aec10f52c206aec4697c76 (patch)
tree699059b20bacea6403886dd63e47261cb348d94f /src/Window.cc
parent4093d2641f371bb8e80616a4c51dea9af508dac2 (diff)
downloadfluxbox-06d696f99b276e3394aec10f52c206aec4697c76.zip
fluxbox-06d696f99b276e3394aec10f52c206aec4697c76.tar.bz2
fix some consts and private functions
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 866e160..6f8d0f7 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -874,7 +874,6 @@ void FluxboxWindow::moveClientRight() {
874 updateClientLeftWindow(); 874 updateClientLeftWindow();
875} 875}
876 876
877//list<*WinClient>::iterator FluxboxWindow::getClientInsertPosition(int x, int y) {
878FluxboxWindow::ClientList::iterator FluxboxWindow::getClientInsertPosition(int x, int y) { 877FluxboxWindow::ClientList::iterator FluxboxWindow::getClientInsertPosition(int x, int y) {
879 878
880 int dest_x = 0, dest_y = 0; 879 int dest_x = 0, dest_y = 0;
@@ -1261,25 +1260,18 @@ void FluxboxWindow::moveResizeForClient(int new_x, int new_y,
1261 1260
1262} 1261}
1263 1262
1264void FluxboxWindow::maxSize(unsigned int &max_width, unsigned int &max_height) { 1263void FluxboxWindow::maxSize(unsigned int &width, unsigned int &height) const {
1265 ClientList::const_iterator it = clientList().begin(); 1264 ClientList::const_iterator it = clientList().begin();
1266 ClientList::const_iterator it_end = clientList().end(); 1265 ClientList::const_iterator it_end = clientList().end();
1267 max_width = (unsigned int) ~0; // unlimited 1266 width = height = 0; // unlimited
1268 max_height = (unsigned int) ~0; // unlimited
1269 for (; it != it_end; ++it) { 1267 for (; it != it_end; ++it) {
1270 // special case for max height/width == 0 1268 // special case for max height/width == 0
1271 // 0 indicates unlimited size, so we skip them 1269 // 0 indicates unlimited size, so we skip them
1272 // and set max size to 0 if max size == ~0 after the loop 1270 if (!height || (*it)->maxHeight() && height > (*it)->maxHeight())
1273 if ((*it)->maxHeight() != 0) 1271 height = (*it)->maxHeight();
1274 max_height = std::min( (*it)->maxHeight(), max_height ); 1272 if (!width || (*it)->maxWidth() && width > (*it)->maxWidth())
1275 if ((*it)->maxWidth() != 0) 1273 width = (*it)->maxWidth();
1276 max_width = std::min( (*it)->maxWidth(), max_width );
1277 } 1274 }
1278
1279 if (max_width == (unsigned int) ~0)
1280 max_width = 0;
1281 if (max_height == (unsigned int) ~0)
1282 max_height = 0;
1283} 1275}
1284 1276
1285// returns whether the focus was "set" to this window 1277// returns whether the focus was "set" to this window
@@ -2597,7 +2589,7 @@ void FluxboxWindow::keyPressEvent(XKeyEvent &ke) {
2597 gettimeofday(&m_last_keypress_time, 0); 2589 gettimeofday(&m_last_keypress_time, 0);
2598} 2590}
2599 2591
2600bool FluxboxWindow::isTyping() { 2592bool FluxboxWindow::isTyping() const {
2601 timeval now; 2593 timeval now;
2602 if (gettimeofday(&now, NULL) == -1) 2594 if (gettimeofday(&now, NULL) == -1)
2603 return false; 2595 return false;
@@ -3345,7 +3337,7 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
3345} 3337}
3346 3338
3347FluxboxWindow::ResizeDirection FluxboxWindow::getResizeDirection(int x, int y, 3339FluxboxWindow::ResizeDirection FluxboxWindow::getResizeDirection(int x, int y,
3348 ResizeModel model) { 3340 ResizeModel model) const {
3349 int cx = frame().width() / 2; 3341 int cx = frame().width() / 2;
3350 int cy = frame().height() / 2; 3342 int cy = frame().height() / 2;
3351 if (model == CENTERRESIZE) 3343 if (model == CENTERRESIZE)