resize fullscreen windows when resolution changes

This commit is contained in:
Mark Tiefenbruck 2008-09-02 11:41:55 -04:00
parent f01e0c9c5a
commit f9ed11a351
2 changed files with 13 additions and 5 deletions

View file

@ -1460,6 +1460,8 @@ void FluxboxWindow::setFullscreen(bool flag) {
moveToLayer(m_old_layernum); moveToLayer(m_old_layernum);
stateSig().notify(); stateSig().notify();
} }
attachWorkAreaSig();
} }
void FluxboxWindow::setFullscreenLayer() { void FluxboxWindow::setFullscreenLayer() {
@ -1478,6 +1480,15 @@ void FluxboxWindow::setFullscreenLayer() {
} }
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 Maximize window both horizontal and vertical
*/ */
@ -1500,11 +1511,7 @@ void FluxboxWindow::setMaximizedState(int type) {
m_state.maximized = type; m_state.maximized = type;
frame().applyState(); frame().applyState();
// notify when struts change, so we can resize accordingly attachWorkAreaSig();
if (m_state.maximized)
screen().workspaceAreaSig().attach(this);
else
screen().workspaceAreaSig().detach(this);
// notify listeners that we changed state // notify listeners that we changed state
stateSig().notify(); stateSig().notify();

View file

@ -501,6 +501,7 @@ private:
void setState(unsigned long stateval, bool setting_up); void setState(unsigned long stateval, bool setting_up);
/// set the layer of a fullscreen window /// set the layer of a fullscreen window
void setFullscreenLayer(); void setFullscreenLayer();
void attachWorkAreaSig();
// modifies left and top if snap is necessary // modifies left and top if snap is necessary
void doSnapping(int &left, int &top); void doSnapping(int &left, int &top);