all repos — fluxbox @ 6ba7744f65453a2705ba1bb88ce355c4cfde9276

custom fork of the fluxbox windowmanager

Tab command, thanks Steeve Lennmark, steeve dot lennmark at mediasvar dot se
fluxgen fluxgen
commit

6ba7744f65453a2705ba1bb88ce355c4cfde9276

parent

cc486c194f862bf0d8d8b3644c321446b0d3f051

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

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

@@ -60,6 +60,18 @@ if ( workspace_num < 0 ) workspace_num+= fbwindow().screen().getNumberOfWorkspaces();

fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); } +void GoToTabCmd::real_execute() { + if (fbwindow().numClients() <= 1 || m_tab_num > fbwindow().numClients()) + return; + + FluxboxWindow::ClientList::iterator it = fbwindow().clientList().begin(); + + int num = m_tab_num; + while (--num > 0) ++it; + + fbwindow().setCurrentClient(**it, true); +} + void WindowHelperCmd::execute() { WinClient *client = Fluxbox::instance()->getFocusedWindow(); if (client && client->fbwindow()) // guarantee that fbwindow() exists too
M src/CurrentWindowCmd.hhsrc/CurrentWindowCmd.hh

@@ -87,6 +87,16 @@ private:

const int m_workspace_num; }; +// goto tab +class GoToTabCmd: public WindowHelperCmd { +public: + explicit GoToTabCmd(int tab_num):m_tab_num(tab_num) { } +protected: + void real_execute(); +private: + const int m_tab_num; +}; + // move cmd, relative position class MoveCmd: public WindowHelperCmd { public:
M src/FbCommandFactory.ccsrc/FbCommandFactory.cc

@@ -131,6 +131,7 @@ "shadewindow",

"showdesktop", "stick", "stickwindow", + "tab", "toggledecor", "windowmenu", "workspace",

@@ -286,7 +287,13 @@ else if (command == "sendtoprevworkspace")

return new SendToPrevWorkspaceCmd(atoi(arguments.c_str())); else if (command == "killwindow" || command == "kill") return new KillWindowCmd(); - else if (command == "nexttab") + else if (command == "tab") { + // XXX + int num = 1; + if (!arguments.empty()) + num = atoi(arguments.c_str()); + return new GoToTabCmd(num); + } else if (command == "nexttab") return new CurrentWindowCmd(&FluxboxWindow::nextClient); else if (command == "prevtab") return new CurrentWindowCmd(&FluxboxWindow::prevClient);