summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-01-16 16:25:43 (GMT)
committermarkt <markt>2007-01-16 16:25:43 (GMT)
commita8e3f500c29c9d0c94233ce499e54fadd83fa764 (patch)
tree96042412ce9cb9856af4bc926b263b4aeae07c5e
parent4bb6a027e31cd91b06eecd1cd942f7a2d8cd8fa2 (diff)
downloadfluxbox_lack-a8e3f500c29c9d0c94233ce499e54fadd83fa764.zip
fluxbox_lack-a8e3f500c29c9d0c94233ce499e54fadd83fa764.tar.bz2
right click on iconbutton toggles menu
-rw-r--r--ChangeLog2
-rw-r--r--src/IconButton.cc15
2 files changed, 8 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a9b89ca..6b2735a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0rc3: 2Changes for 1.0rc3:
3*07/01/16: 3*07/01/16:
4 * Make right-clicking on iconbar button behave the same way as tabs (Mark)
5 IconButton.cc
4 * Don't force user to reconfigure manually in order to apply menu and 6 * Don't force user to reconfigure manually in order to apply menu and
5 default window transparency changes; instead, in order to conserve system 7 default window transparency changes; instead, in order to conserve system
6 resources, do it a half-second after the user stops changing them (Mark) 8 resources, do it a half-second after the user stops changing them (Mark)
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));