all repos — fluxbox @ 6c82cd5f8450dbd3f27f14d19bf5e23a77053d2f

custom fork of the fluxbox windowmanager

bugfix: do not change workspaces when using NextWindow / PrevWindow buttons in toolbar
Mathias Gumz akira at fluxbox dot org
commit

6c82cd5f8450dbd3f27f14d19bf5e23a77053d2f

parent

0708d1e046f375a315baeae7c24903e4d5bf124d

1 files changed, 8 insertions(+), 3 deletions(-)

jump to
M src/ToolFactory.ccsrc/ToolFactory.cc

@@ -91,14 +91,19 @@ item = new SystemTray(parent, dynamic_cast<ButtonTheme &>(*m_systray_theme), screen());

} else if (name == "clock") { item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu()); } else { - FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(name)); + + std::string cmd_str = name; + if (name == "prevwindow" || name == "nextwindow") { + cmd_str += " (workspace=[current])"; + } + + FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::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,