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
2 files changed,
17 insertions(+),
5 deletions(-)
M
src/Window.cc
→
src/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.hh
→
src/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