added little helper function to disable the maximization state of a window while keeping its current position / size
This commit is contained in:
parent
d2a7cc60a2
commit
a2f809f8f2
2 changed files with 17 additions and 5 deletions
|
@ -1509,6 +1509,18 @@ void FluxboxWindow::setMaximizedState(int type) {
|
|||
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 @@ void FluxboxWindow::startResizing(int x, int y, ReferenceCorner dir) {
|
|||
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() :
|
||||
|
|
|
@ -224,6 +224,10 @@ public:
|
|||
void maximizeVertical();
|
||||
/// maximizes the window fully
|
||||
void maximizeFull();
|
||||
|
||||
/// disables maximization, without restoring the old size
|
||||
void disableMaximization();
|
||||
|
||||
/// toggles shade
|
||||
void shade();
|
||||
/// shades window
|
||||
|
|
Loading…
Reference in a new issue