diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt index 8fc0bd17..7848f03f 100644 --- a/doc/asciidoc/fluxbox.txt +++ b/doc/asciidoc/fluxbox.txt @@ -557,7 +557,9 @@ The possible tools are: The Systemtray can hold applications that are made to use it. *WorkspaceName*::: - This displays the name of the current workspace. + This displays the name of the current workspace. Also, one is able to switch + to the workspace left of the current one with a left click and to the + workspace right of the current one with a right click. *PrevWorkspace*::: This displays an arrow that allows one to switch to the workspace left of @@ -577,7 +579,7 @@ The possible tools are: Other aspects of the toolbar can be configured in two ways: through the toolbar menu, which is accessible in the Configuration part of the RootMenu or with a -right click on the edge the toolbar, or by editing the init file (see the +middle click on the edge the toolbar, or by editing the init file (see the *RESOURCES* section for more information about that). Toolbar Menu diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc index 5da2777c..40343130 100644 --- a/src/ToolFactory.cc +++ b/src/ToolFactory.cc @@ -75,6 +75,8 @@ ToolFactory::ToolFactory(BScreen &screen):m_screen(screen), ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &parent, Toolbar &tbar) { ToolbarItem * item = 0; + FbTk::CommandParser& cp = FbTk::CommandParser::instance(); + unsigned int button_size = 24; if (tbar.theme()->buttonSize() > 0) button_size = tbar.theme()->buttonSize(); @@ -83,8 +85,10 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow & WorkspaceNameTool *witem = new WorkspaceNameTool(parent, *m_workspace_theme, screen()); using namespace FbTk; - RefCount > showmenu(new ShowMenuAboveToolbar(tbar)); - witem->button().setOnClick(showmenu); + RefCount< Command > leftCommand(cp.parse("prevworkspace")); + RefCount< Command > rightCommand(cp.parse("nextworkspace")); + witem->button().setOnClick(leftCommand); + witem->button().setOnClick(rightCommand, 3); item = witem; } else if (name == "iconbar") { item = new IconbarTool(parent, m_iconbar_theme, m_focused_iconbar_theme, m_unfocused_iconbar_theme, screen(), tbar.menu()); @@ -101,7 +105,7 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow & cmd_str += " (workspace=[current])"; } - FbTk::RefCount > cmd(FbTk::CommandParser::instance().parse(cmd_str)); + FbTk::RefCount > cmd(cp.parse(cmd_str)); if (cmd == 0) // we need a command return 0; diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 5f4cc807..c43a419c 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -517,7 +517,7 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) { if (be.button == 1) raise(); - if (be.button != 3) + if (be.button != 2) return; screen()