From 2e96a07cf74d66f204ce37daef2c9cc6a7c0b357 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 16 Nov 2007 23:33:34 +0000 Subject: added :Focus key command --- ChangeLog | 3 +++ src/FbCommandFactory.cc | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0ad38a..95cce9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 1.0.1: *07/11/16: + * Added new key command :Focus [] that focuses a window (e.g., using + OnWindow or specified using a window pattern) (Mark, thanks Tomas Janousek) + FbCommandFactory.cc * Using ToggleDecor from Deco=TAB should hide tabs (thanks Tomas Janousek) Window.cc *07/11/12: diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index 72de740..ce024eb 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc @@ -65,9 +65,10 @@ static int getint(const char *str, int defaultvalue) { FbCommandFactory::FbCommandFactory() { // setup commands that we can handle const char* commands[] = { - "addworkspace", + "activate", + "addworkspace", "arrangewindows", - "attach", + "attach", "bindkey", "clientmenu", "close", @@ -81,6 +82,7 @@ FbCommandFactory::FbCommandFactory() { "execcommand", "execute", "exit", + "focus", "focusup", "focusdown", "focusleft", @@ -124,7 +126,7 @@ FbCommandFactory::FbCommandFactory() { "reconfig", "reconfigure", "reloadstyle", - "removelastworkspace", + "removelastworkspace", "resizeto", "resize", "resizehorizontal", @@ -419,6 +421,8 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, return new WindowListCmd(FbTk::RefCount(new CurrentWindowCmd(&FluxboxWindow::lower)), arguments); else if (command == "lowerlayer") return new WindowListCmd(FbTk::RefCount(new CurrentWindowCmd(&FluxboxWindow::lowerLayer)), arguments); + else if (command == "activate" || command == "focus") + return new WindowListCmd(FbTk::RefCount(new CurrentWindowCmd((void (FluxboxWindow::*)())&FluxboxWindow::focus)), arguments); else if (command == "close") return new WindowListCmd(FbTk::RefCount(new CurrentWindowCmd(&FluxboxWindow::close)), arguments); else if (command == "closeallwindows") -- cgit v0.11.2