aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-05-06 18:07:56 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-05-06 18:07:56 (GMT)
commita2f809f8f254e96739de6015e7475a3ae4cc2a62 (patch)
tree4cfa5086c796f2d8897444a050dbe159bacd15e6
parentd2a7cc60a2e27e450ffc84b8db4c68199dfda5e1 (diff)
downloadfluxbox_paul-a2f809f8f254e96739de6015e7475a3ae4cc2a62.zip
fluxbox_paul-a2f809f8f254e96739de6015e7475a3ae4cc2a62.tar.bz2
added little helper function to disable the maximization state of a window while keeping its current position / size
-rw-r--r--src/Window.cc18
-rw-r--r--src/Window.hh4
2 files changed, 17 insertions, 5 deletions
diff --git a/src/Window.cc b/src/Window.cc
index f64db65..9df48a2 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1509,6 +1509,18 @@ void FluxboxWindow::setMaximizedState(int type) {
1509 stateSig().notify(); 1509 stateSig().notify();
1510} 1510}
1511 1511
1512void FluxboxWindow::disableMaximization() {
1513
1514 m_state.maximized = WindowState::MAX_NONE;
1515 // TODO: could be optional, if the window gets back to original size /
1516 // position after maximization is disabled
1517 m_state.saveGeometry(frame().x(), frame().y(),
1518 frame().width(), frame().height());
1519 frame().applyState();
1520 stateSig().notify();
1521}
1522
1523
1512/** 1524/**
1513 * Maximize window horizontal 1525 * Maximize window horizontal
1514 */ 1526 */
@@ -3079,12 +3091,8 @@ void FluxboxWindow::startResizing(int x, int y, ReferenceCorner dir) {
3079 m_resize_corner = dir; 3091 m_resize_corner = dir;
3080 3092
3081 resizing = true; 3093 resizing = true;
3082 m_state.maximized = WindowState::MAX_NONE;
3083 m_state.saveGeometry(frame().x(), frame().y(),
3084 frame().width(), frame().height());
3085 3094
3086 frame().applyState(); 3095 disableMaximization();
3087 stateSig().notify();
3088 3096
3089 const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme()->upperLeftAngleCursor() : 3097 const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme()->upperLeftAngleCursor() :
3090 (m_resize_corner == RIGHTTOP) ? frame().theme()->upperRightAngleCursor() : 3098 (m_resize_corner == RIGHTTOP) ? frame().theme()->upperRightAngleCursor() :
diff --git a/src/Window.hh b/src/Window.hh
index a097ac6..5554ad3 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -224,6 +224,10 @@ public:
224 void maximizeVertical(); 224 void maximizeVertical();
225 /// maximizes the window fully 225 /// maximizes the window fully
226 void maximizeFull(); 226 void maximizeFull();
227
228 /// disables maximization, without restoring the old size
229 void disableMaximization();
230
227 /// toggles shade 231 /// toggles shade
228 void shade(); 232 void shade();
229 /// shades window 233 /// shades window