aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc24
-rw-r--r--src/Window.hh27
2 files changed, 21 insertions, 30 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)
diff --git a/src/Window.hh b/src/Window.hh
index 05c4342..f0a390c 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -199,14 +199,6 @@ public:
199 */ 199 */
200 void moveClientTo(WinClient &win, int x, int y); 200 void moveClientTo(WinClient &win, int x, int y);
201 /** 201 /**
202 * Calculates insertition position in the list by
203 * using pixel position x and y.
204 * @param x position
205 * @param y position
206 * @return iterator position for insertion
207 */
208 ClientList::iterator getClientInsertPosition(int x, int y);
209 /**
210 * Take focus. 202 * Take focus.
211 * @see Focusable 203 * @see Focusable
212 * @return true if it took focus. 204 * @return true if it took focus.
@@ -313,7 +305,7 @@ public:
313 * @param width will be filled in with maximum width 305 * @param width will be filled in with maximum width
314 * @param height will be filled in with maximum height 306 * @param height will be filled in with maximum height
315 */ 307 */
316 void maxSize(unsigned int &width, unsigned int &height); 308 void maxSize(unsigned int &width, unsigned int &height) const;
317 void setWorkspace(int n); 309 void setWorkspace(int n);
318 void updateFunctions(); 310 void updateFunctions();
319 void restoreAttributes(); 311 void restoreAttributes();
@@ -381,7 +373,7 @@ public:
381 */ 373 */
382 void startResizing(int x, int y, ResizeDirection dir); 374 void startResizing(int x, int y, ResizeDirection dir);
383 /// determine which edge or corner to resize 375 /// determine which edge or corner to resize
384 ResizeDirection getResizeDirection(int x, int y, ResizeModel model); 376 ResizeDirection getResizeDirection(int x, int y, ResizeModel model) const;
385 /// stops the resizing 377 /// stops the resizing
386 void stopResizing(bool interrupted = false); 378 void stopResizing(bool interrupted = false);
387 /// starts tabbing 379 /// starts tabbing
@@ -395,7 +387,7 @@ public:
395 // whether this window can be tabbed with other windows, 387 // whether this window can be tabbed with other windows,
396 // and others tabbed with it 388 // and others tabbed with it
397 void setTabable(bool tabable) { functions.tabable = tabable; } 389 void setTabable(bool tabable) { functions.tabable = tabable; }
398 bool isTabable() { return functions.tabable; } 390 bool isTabable() const { return functions.tabable; }
399 void setMovable(bool movable) { functions.move = movable; } 391 void setMovable(bool movable) { functions.move = movable; }
400 void setResizable(bool resizable) { functions.resize = resizable; } 392 void setResizable(bool resizable) { functions.resize = resizable; }
401 393
@@ -403,9 +395,7 @@ public:
403 bool isIconHidden() const { return m_icon_hidden; } 395 bool isIconHidden() const { return m_icon_hidden; }
404 bool isManaged() const { return m_initialized; } 396 bool isManaged() const { return m_initialized; }
405 bool isVisible() const; 397 bool isVisible() const;
406 bool isIconic() { return iconic; }
407 bool isIconic() const { return iconic; } 398 bool isIconic() const { return iconic; }
408 bool isShaded() { return shaded; }
409 bool isShaded() const { return shaded; } 399 bool isShaded() const { return shaded; }
410 bool isFullscreen() const { return fullscreen; } 400 bool isFullscreen() const { return fullscreen; }
411 bool isMaximized() const { return maximized == MAX_FULL; } 401 bool isMaximized() const { return maximized == MAX_FULL; }
@@ -429,7 +419,7 @@ public:
429 WinClient &winClient() { return *m_client; } 419 WinClient &winClient() { return *m_client; }
430 const WinClient &winClient() const { return *m_client; } 420 const WinClient &winClient() const { return *m_client; }
431 421
432 bool isTyping(); 422 bool isTyping() const;
433 423
434 const FbTk::XLayerItem &layerItem() const { return m_frame.layerItem(); } 424 const FbTk::XLayerItem &layerItem() const { return m_frame.layerItem(); }
435 FbTk::XLayerItem &layerItem() { return m_frame.layerItem(); } 425 FbTk::XLayerItem &layerItem() { return m_frame.layerItem(); }
@@ -523,6 +513,15 @@ private:
523 void updateClientLeftWindow(); 513 void updateClientLeftWindow();
524 void grabButtons(); 514 void grabButtons();
525 515
516 /**
517 * Calculates insertition position in the list by
518 * using pixel position x and y.
519 * @param x position
520 * @param y position
521 * @return iterator position for insertion
522 */
523 ClientList::iterator getClientInsertPosition(int x, int y);
524
526 /// try to attach current attaching client to a window at pos x, y 525 /// try to attach current attaching client to a window at pos x, y
527 void attachTo(int x, int y, bool interrupted = false); 526 void attachTo(int x, int y, bool interrupted = false);
528 527