aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2011-09-01 15:08:50 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-09-01 15:08:50 (GMT)
commit6c82cd5f8450dbd3f27f14d19bf5e23a77053d2f (patch)
tree6eb514ec292d2a913e43dc6b0171d672f41cc8bb /src
parent0708d1e046f375a315baeae7c24903e4d5bf124d (diff)
downloadfluxbox-6c82cd5f8450dbd3f27f14d19bf5e23a77053d2f.zip
fluxbox-6c82cd5f8450dbd3f27f14d19bf5e23a77053d2f.tar.bz2
bugfix: do not change workspaces when using NextWindow / PrevWindow buttons in toolbar
Diffstat (limited to 'src')
-rw-r--r--src/ToolFactory.cc11
1 files 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 &
91 } else if (name == "clock") { 91 } else if (name == "clock") {
92 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu()); 92 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu());
93 } else { 93 } else {
94 FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(name)); 94
95 std::string cmd_str = name;
96 if (name == "prevwindow" || name == "nextwindow") {
97 cmd_str += " (workspace=[current])";
98 }
99
100 FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(cmd_str));
95 if (cmd == 0) // we need a command 101 if (cmd == 0) // we need a command
96 return 0; 102 return 0;
97 103
98 // TODO maybe direction of arrows should depend on toolbar layout ? 104 // TODO maybe direction of arrows should depend on toolbar layout ?
99 FbTk::FbDrawable::TriangleType arrow_type = FbTk::FbDrawable::RIGHT; 105 FbTk::FbDrawable::TriangleType arrow_type = FbTk::FbDrawable::RIGHT;
100 const char *tmp = name.c_str(); 106 if (name.find("prev") != std::string::npos)
101 if (FbTk::StringUtil::strcasestr(tmp, "prev"))
102 arrow_type = FbTk::FbDrawable::LEFT; 107 arrow_type = FbTk::FbDrawable::LEFT;
103 108
104 ArrowButton *win = new ArrowButton(arrow_type, parent, 109 ArrowButton *win = new ArrowButton(arrow_type, parent,