all repos — fluxbox @ 6c0565c482b496b7d34e3731415829e7c4872535

custom fork of the fluxbox windowmanager

add commands to toggle toolbar and slit layer

toggle(Toolbar|Slit)Above toggles the resp. item between its
regular and the AboveDock layer (ie. above everything, even visible on
active fullscreen windows)

Also required step for autoraising.

REQUEST: 222
Thomas Lübking thomas.luebking@gmail.com
commit

6c0565c482b496b7d34e3731415829e7c4872535

parent

f22435d60bf7a52e00608576074dd791e8731bf2

M doc/asciidoc/fluxbox-keys.txtdoc/asciidoc/fluxbox-keys.txt

@@ -438,6 +438,12 @@ *ShowDesktop*::

Minimizes all windows on the current workspace. If they are already all minimized, then it restores them. +*ToggleSlitAbove*:: + Toggles the slit between its regular and the AboveDock layer + +*ToggleToolbarAbove*:: + Toggles the toolbar between its regular and the AboveDock layer + *Deiconify* 'mode' 'destination':: Deiconifies windows (or, restores from a minimized state). +
M src/Screen.hhsrc/Screen.hh

@@ -126,6 +126,11 @@ /// @return the slit, @see Slit

Slit *slit() { return m_slit.get(); } /// @return the slit, @see Slit const Slit *slit() const { return m_slit.get(); } + + /// @return the toolbar, @see Toolbar + Toolbar *toolbar() { return m_toolbar.get(); } + /// @return the toolbar, @see Toolbar + const Toolbar *toolbar() const { return m_toolbar.get(); } /** * @param w the workspace number * @return workspace for the given workspace number
M src/Slit.ccsrc/Slit.cc

@@ -1064,6 +1064,13 @@ }

} } +void Slit::toggleAboveDock() { + if (m_layeritem->getLayerNum() == m_rc_layernum->getNum()) + m_layeritem->moveToLayer(ResourceLayer::ABOVE_DOCK); + else + m_layeritem->moveToLayer(m_rc_layernum->getNum()); +} + void Slit::loadClientList(const char *filename) { if (filename == 0 || filename[0] == '\0') return;
M src/Slit.hhsrc/Slit.hh

@@ -103,6 +103,7 @@ //@}

void moveToLayer(int layernum); void toggleHidden(); + void toggleAboveDock(); BScreen &screen() { return m_screen; } const BScreen &screen() const { return m_screen; }
M src/Toolbar.ccsrc/Toolbar.cc

@@ -719,6 +719,13 @@ }

} +void Toolbar::toggleAboveDock() { + if (m_layeritem.getLayerNum() == m_rc_layernum->getNum()) + m_layeritem.moveToLayer(ResourceLayer::ABOVE_DOCK); + else + m_layeritem.moveToLayer(m_rc_layernum->getNum()); +} + void Toolbar::moveToLayer(int layernum) { m_layeritem.moveToLayer(layernum); *m_rc_layernum = layernum;
M src/Toolbar.hhsrc/Toolbar.hh

@@ -83,6 +83,7 @@ void lower();

void updateVisibleState(); void toggleHidden(); + void toggleAboveDock(); void moveToLayer(int layernum);
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -26,6 +26,8 @@ #include "Layer.hh"

#include "Workspace.hh" #include "Window.hh" #include "Screen.hh" +#include "Slit.hh" +#include "Toolbar.hh" #include "fluxbox.hh" #include "WinClient.hh" #include "FocusControl.hh"

@@ -620,6 +622,26 @@ }

} else FocusControl::revertFocus(*screen); +} + +REGISTER_COMMAND(toggleslitbarabove, ToggleSlitAboveCmd, void); +void ToggleSlitAboveCmd::execute() { +#if USE_SLIT + if (BScreen *screen = Fluxbox::instance()->mouseScreen()) { + screen->slit()->toggleAboveDock(); + const_cast<FbTk::FbWindow&>(screen->slit()->window()).raise(); + } +#endif +} + +REGISTER_COMMAND(toggletoolbarabove, ToggleToolbarAboveCmd, void); +void ToggleToolbarAboveCmd::execute() { +#if USE_TOOLBAR + if (BScreen *screen = Fluxbox::instance()->mouseScreen()) { + screen->toolbar()->toggleAboveDock(); + const_cast<FbTk::FbWindow&>(screen->toolbar()->window()).raise(); + } +#endif } REGISTER_COMMAND(closeallwindows, CloseAllWindowsCmd, void);
M src/WorkspaceCmd.hhsrc/WorkspaceCmd.hh

@@ -192,6 +192,16 @@ public:

void execute(); }; +class ToggleSlitAboveCmd: public FbTk::Command<void> { +public: + void execute(); +}; + +class ToggleToolbarAboveCmd: public FbTk::Command<void> { +public: + void execute(); +}; + class CloseAllWindowsCmd: public FbTk::Command<void> { public: void execute();