From bf81d4e6c31546bf92ea160055bf6e2fdc8225f5 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 22 Jun 2003 14:17:17 +0000 Subject: removing strut when maximize over is set --- src/Slit.cc | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Slit.cc b/src/Slit.cc index a219fd8..c349230 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.63 2003/06/22 12:31:37 fluxgen Exp $ +// $Id: Slit.cc,v 1.64 2003/06/22 14:17:17 fluxgen Exp $ #include "Slit.hh" @@ -39,10 +39,11 @@ #include "Screen.hh" #include "ImageControl.hh" #include "RefCount.hh" -#include "SimpleCommand.hh" #include "BoolMenuItem.hh" #include "EventManager.hh" +#include "SimpleCommand.hh" #include "MacroCommand.hh" +#include "FbCommands.hh" #include "LayerMenu.hh" #include "fluxbox.hh" #include "XLayer.hh" @@ -78,6 +79,9 @@ public: explicit SlitClientMenuItem(SlitClient &client, FbTk::RefCount &cmd): FbTk::MenuItem(client.matchName().c_str(), cmd), m_client(client) { FbTk::MenuItem::setSelected(client.visible()); + // save resources as default click action + FbTk::RefCount save_rc(new FbCommands::SaveResources()); + setCommand(save_rc); } const std::string &label() const { return m_client.matchName(); @@ -88,7 +92,6 @@ public: void click(int button, int time) { m_client.setVisible(!m_client.visible()); FbTk::MenuItem::click(button, time); - Fluxbox::instance()->save_rc(); } private: SlitClient &m_client; @@ -258,10 +261,16 @@ void Slit::clearStrut() { } void Slit::updateStrut() { + bool had_strut = m_strut ? true : false; clearStrut(); - // no need for area if we're autohiding - if (doAutoHide()) + // no need for area if we're autohiding or set maximize over + if (doAutoHide() || *m_rc_maximize_over) { + // update screen area if we had a strut before + if (had_strut) + screen().updateAvailableWorkspaceArea(); return; + } + int left = 0, right = 0, top = 0, bottom = 0; switch (placement()) { @@ -532,6 +541,7 @@ void Slit::removeClient(Window w, bool remap) { void Slit::reconfigure() { + m_transp->setAlpha(*m_rc_alpha); frame.width = 0; @@ -686,7 +696,6 @@ void Slit::reconfigure() { updateClientmenu(); updateStrut(); - } @@ -809,9 +818,6 @@ void Slit::reposition() { frame.window.moveResize(frame.x, frame.y, frame.width, frame.height); } -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): frame("< saverc_cmd(new FbTk::SimpleCommand(*Fluxbox::instance(), - &Fluxbox::save_rc)); + FbTk::RefCount saverc_cmd(new FbCommands::SaveResources()); FbTk::RefCount reconf_cmd(new FbCommands::ReconfigureFluxboxCmd()); FbTk::RefCount reconf_slit_cmd(new FbTk::SimpleCommand(*this, &Slit::reconfigure)); -- cgit v0.11.2