From 6c82cd5f8450dbd3f27f14d19bf5e23a77053d2f Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Thu, 1 Sep 2011 17:08:50 +0200 Subject: bugfix: do not change workspaces when using NextWindow / PrevWindow buttons in toolbar --- src/ToolFactory.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc index d94105d..ee4666e 100644 --- a/src/ToolFactory.cc +++ b/src/ToolFactory.cc @@ -91,14 +91,19 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow & } else if (name == "clock") { item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu()); } else { - FbTk::RefCount > cmd(FbTk::CommandParser::instance().parse(name)); + + std::string cmd_str = name; + if (name == "prevwindow" || name == "nextwindow") { + cmd_str += " (workspace=[current])"; + } + + FbTk::RefCount > cmd(FbTk::CommandParser::instance().parse(cmd_str)); if (cmd == 0) // we need a command return 0; // TODO maybe direction of arrows should depend on toolbar layout ? FbTk::FbDrawable::TriangleType arrow_type = FbTk::FbDrawable::RIGHT; - const char *tmp = name.c_str(); - if (FbTk::StringUtil::strcasestr(tmp, "prev")) + if (name.find("prev") != std::string::npos) arrow_type = FbTk::FbDrawable::LEFT; ArrowButton *win = new ArrowButton(arrow_type, parent, -- cgit v0.11.2