From e6b11e06c67d0c7987410097b62f730dcd88db3a Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sat, 23 Aug 2008 07:46:16 -0700 Subject: resize maximized windows when the toolbar or slit changes size --- src/FbWinFrame.cc | 7 +++---- src/Window.cc | 16 +++++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 1f0a52e..4533fa6 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -198,8 +198,6 @@ void FbWinFrame::shade() { return; // toggle shade - if (!m_state.shaded) - saveGeometry(); m_state.shaded = !m_state.shaded; applyState(); } @@ -256,6 +254,8 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh m_window.resize(width, height); } + saveGeometry(); + if (move || (resize && m_screen.getTabPlacement() != TOPLEFT && m_screen.getTabPlacement() != LEFTTOP)) alignTabs(); @@ -283,6 +283,7 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh void FbWinFrame::quietMoveResize(int x, int y, unsigned int width, unsigned int height) { m_window.moveResize(x, y, width, height); + saveGeometry(); if (m_tabmode == EXTERNAL) { switch(m_screen.getTabPlacement()) { @@ -521,7 +522,6 @@ void FbWinFrame::setFullscreen(bool newvalue) { if (newvalue == m_state.fullscreen) return; - saveGeometry(); m_state.fullscreen = newvalue; applyState(); } @@ -530,7 +530,6 @@ void FbWinFrame::setMaximized(int value) { if (value == m_state.maximized) return; - saveGeometry(); m_state.maximized = value; applyState(); } diff --git a/src/Window.cc b/src/Window.cc index b175314..4b77b95 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -1538,6 +1538,12 @@ void FluxboxWindow::setMaximizedState(int type) { maximized = type; frame().setMaximized(type); + // notify when struts change, so we can resize accordingly + if (maximized) + screen().workspaceAreaSig().attach(this); + else + screen().workspaceAreaSig().detach(this); + // notify listeners that we changed state stateSig().notify(); } @@ -2771,14 +2777,14 @@ void FluxboxWindow::update(FbTk::Subject *subj) { titleSig().notify(); } - } else if (subj && typeid(*subj) == typeid(BScreen::ScreenSubject)) { - if (subj == &screen().focusedWindowSig()) { - if (FocusControl::focusedFbWindow()) - setFullscreenLayer(); - } + } else if (subj == &screen().focusedWindowSig()) { + if (FocusControl::focusedFbWindow()) + setFullscreenLayer(); } else if (subj == &m_theme.reconfigSig()) { frame().applyDecorations(); sendConfigureNotify(); + } else if (subj == &screen().workspaceAreaSig()) { + frame().applyState(); } else if (m_initialized && subj == &m_frame.frameExtentSig()) { Fluxbox::instance()->updateFrameExtents(*this); sendConfigureNotify(); -- cgit v0.11.2