aboutsummaryrefslogtreecommitdiff
path: root/src/IconButton.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/IconButton.cc')
-rw-r--r--src/IconButton.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index eaae85e..545ee1d 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -30,6 +30,7 @@
30#include "Window.hh" 30#include "Window.hh"
31#include "WinClient.hh" 31#include "WinClient.hh"
32#include "CommandParser.hh" 32#include "CommandParser.hh"
33#include "WindowCmd.hh"
33 34
34#include "FbTk/App.hh" 35#include "FbTk/App.hh"
35#include "FbTk/SimpleCommand.hh" 36#include "FbTk/SimpleCommand.hh"
@@ -56,6 +57,11 @@ class ShowMenu: public FbTk::Command {
56public: 57public:
57 explicit ShowMenu(FluxboxWindow &win):m_win(win) { } 58 explicit ShowMenu(FluxboxWindow &win):m_win(win) { }
58 void execute() { 59 void execute() {
60 // hide the menu if it's already showing for this FluxboxWindow
61 if (m_win.menu().isVisible() && WindowCmd<void>::window() == &m_win) {
62 m_win.screen().hideMenus();
63 return;
64 }
59 m_win.screen().hideMenus(); 65 m_win.screen().hideMenus();
60 // get last button pos 66 // get last button pos
61 const XEvent &event = Fluxbox::instance()->lastEvent(); 67 const XEvent &event = Fluxbox::instance()->lastEvent();
@@ -146,15 +152,6 @@ IconButton::IconButton(const IconbarTool& tool, const FbTk::FbWindow &parent,
146 152
147 RefCmd next_workspace(new ::WheelWorkspaceCmd(tool, m_win, "nextworkspace")); 153 RefCmd next_workspace(new ::WheelWorkspaceCmd(tool, m_win, "nextworkspace"));
148 RefCmd prev_workspace(new ::WheelWorkspaceCmd(tool, m_win, "prevworkspace")); 154 RefCmd prev_workspace(new ::WheelWorkspaceCmd(tool, m_win, "prevworkspace"));
149
150 //!! TODO: There're some issues with MacroCommand when
151 // this object dies when the last macrocommand is executed (focused cmd)
152 // In iconbar mode Icons
153 //
154 // RefCmd hidemenus(new FbTk::SimpleCommand<BScreen>(win.screen(), &BScreen::hideMenus));
155 // FbTk::MacroCommand *focus_macro = new FbTk::MacroCommand();
156 // focus_macro->add(hidemenus);
157 // focus_macro->add(focus);
158 155
159 RefCmd focus_cmd(new ::FocusCommand(tool, m_win)); 156 RefCmd focus_cmd(new ::FocusCommand(tool, m_win));
160 RefCmd menu_cmd(new ::ShowMenu(m_win)); 157 RefCmd menu_cmd(new ::ShowMenu(m_win));