resize fullscreen windows when resolution changes
Mark Tiefenbruck mark@fluxbox.org
2 files changed,
13 insertions(+),
5 deletions(-)
M
src/Window.cc
→
src/Window.cc
@@ -1460,6 +1460,8 @@
moveToLayer(m_old_layernum); stateSig().notify(); } + + attachWorkAreaSig(); } void FluxboxWindow::setFullscreenLayer() {@@ -1478,6 +1480,15 @@ stateSig().notify();
} +void FluxboxWindow::attachWorkAreaSig() { + // notify when struts change, so we can resize accordingly + // Subject checks for duplicates for us + if (m_state.maximized || m_state.fullscreen) + screen().workspaceAreaSig().attach(this); + else + screen().workspaceAreaSig().detach(this); +} + /** Maximize window both horizontal and vertical */@@ -1500,11 +1511,7 @@
m_state.maximized = type; frame().applyState(); - // notify when struts change, so we can resize accordingly - if (m_state.maximized) - screen().workspaceAreaSig().attach(this); - else - screen().workspaceAreaSig().detach(this); + attachWorkAreaSig(); // notify listeners that we changed state stateSig().notify();
M
src/Window.hh
→
src/Window.hh
@@ -501,6 +501,7 @@
void setState(unsigned long stateval, bool setting_up); /// set the layer of a fullscreen window void setFullscreenLayer(); + void attachWorkAreaSig(); // modifies left and top if snap is necessary void doSnapping(int &left, int &top);