all repos — fluxbox @ a2f809f8f254e96739de6015e7475a3ae4cc2a62

custom fork of the fluxbox windowmanager

added little helper function to disable the maximization state of a window while keeping its current position / size
Mathias Gumz akira at fluxbox dot org
commit

a2f809f8f254e96739de6015e7475a3ae4cc2a62

parent

d2a7cc60a2e27e450ffc84b8db4c68199dfda5e1

2 files changed, 17 insertions(+), 5 deletions(-)

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

@@ -1509,6 +1509,18 @@ // notify listeners that we changed state

stateSig().notify(); } +void FluxboxWindow::disableMaximization() { + + m_state.maximized = WindowState::MAX_NONE; + // TODO: could be optional, if the window gets back to original size / + // position after maximization is disabled + m_state.saveGeometry(frame().x(), frame().y(), + frame().width(), frame().height()); + frame().applyState(); + stateSig().notify(); +} + + /** * Maximize window horizontal */

@@ -3079,12 +3091,8 @@

m_resize_corner = dir; resizing = true; - m_state.maximized = WindowState::MAX_NONE; - m_state.saveGeometry(frame().x(), frame().y(), - frame().width(), frame().height()); - frame().applyState(); - stateSig().notify(); + disableMaximization(); const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme()->upperLeftAngleCursor() : (m_resize_corner == RIGHTTOP) ? frame().theme()->upperRightAngleCursor() :
M src/Window.hhsrc/Window.hh

@@ -224,6 +224,10 @@ /// maximizes the window vertical

void maximizeVertical(); /// maximizes the window fully void maximizeFull(); + + /// disables maximization, without restoring the old size + void disableMaximization(); + /// toggles shade void shade(); /// shades window