all repos — fluxbox @ 4439b3f9b17e9c8bd9682ce967631f03249304bf

custom fork of the fluxbox windowmanager

fixes for/reimplement parts of directional focus movement
rathnor rathnor
commit

4439b3f9b17e9c8bd9682ce967631f03249304bf

parent

bb779745f45c917099fde31c4cea8bb6d6bc6f7d

M ChangeLogChangeLog

@@ -1,8 +1,11 @@

(Format: Year/Month/Day) Changes for 0.9.10: *04/04/28: + * Fix key bindings for directional focus movement (Simon) + - reminder, key actions are: FocusUp, FocusDown, FocusLeft, FocusRight + WorkspaceCmd.hh/cc Screen.hh/cc WinClient.hh/cc FbCommandFactory.cc * Add apps file matching on WM_WINDOW_ROLE (Simon) - - use "role=string". Particularly useful for gaim windows + - use "role=string". Particularly useful for gaim+gimp windows [app] (role=buddy_list) ... ClientPattern.hh/cc FbWindow.hh/cc *04/04/27:
M src/FbCommandFactory.ccsrc/FbCommandFactory.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.29 2004/04/22 21:12:34 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.30 2004/04/28 14:59:11 rathnor Exp $ #include "FbCommandFactory.hh"

@@ -69,6 +69,10 @@ "detachclient",

"exec", "execcommand", "execute", + "focusup", + "focusdown", + "focusleft", + "focusright", "iconify", "killwindow", "leftworkspace",

@@ -276,6 +280,14 @@ } else if (command == "nextwindow")

return new NextWindowCmd(atoi(arguments.c_str())); else if (command == "prevwindow") return new PrevWindowCmd(atoi(arguments.c_str())); + else if (command == "focusup") + return new DirFocusCmd(BScreen::FOCUSUP); + else if (command == "focusdown") + return new DirFocusCmd(BScreen::FOCUSDOWN); + else if (command == "focusleft") + return new DirFocusCmd(BScreen::FOCUSLEFT); + else if (command == "focusright") + return new DirFocusCmd(BScreen::FOCUSRIGHT); else if (command == "nextgroup") return new NextWindowCmd(atoi(arguments.c_str()) ^ BScreen::CYCLEGROUPS); else if (command == "prevgroup")
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.275 2004/04/19 22:44:42 fluxgen Exp $ +// $Id: Screen.cc,v 1.276 2004/04/28 14:59:11 rathnor Exp $ #include "Screen.hh"

@@ -1640,7 +1640,7 @@ cycling_window = focused_list.begin();

} } -void BScreen::dirFocus(FluxboxWindow &win, FocusDir dir) { +void BScreen::dirFocus(FluxboxWindow &win, const FocusDir dir) { // change focus to the window in direction dir from the given window // we scan through the list looking for the window that is "closest"

@@ -1657,7 +1657,11 @@

Workspace::Windows &wins = currentWorkspace()->windowList(); Workspace::Windows::iterator it = wins.begin(); for (; it != wins.end(); ++it) { - if ((*it) == &win) continue; // skip slef + if ((*it) == &win + || (*it)->isIconic() + || (*it)->isFocusHidden() + || !(*it)->winClient().acceptsFocus()) + continue; // skip self // we check things against an edge, and within the bounds (draw a picture) int edge=0, upper=0, lower=0, oedge=0, oupper=0, olower=0;
M src/Screen.hhsrc/Screen.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.139 2004/04/19 22:44:42 fluxgen Exp $ +// $Id: Screen.hh,v 1.140 2004/04/28 14:59:11 rathnor Exp $ #ifndef SCREEN_HH #define SCREEN_HH

@@ -259,7 +259,7 @@ void raiseFocus();

void setFocusedWindow(WinClient &winclient); - void dirFocus(FluxboxWindow &win, FocusDir dir); + void dirFocus(FluxboxWindow &win, const FocusDir dir); void reconfigure(); void rereadMenu();
M src/WinClient.ccsrc/WinClient.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WinClient.cc,v 1.38 2004/04/01 14:06:42 rathnor Exp $ +// $Id: WinClient.cc,v 1.39 2004/04/28 14:59:12 rathnor Exp $ #include "WinClient.hh"

@@ -145,6 +145,12 @@ event.xconfigure.override_redirect = false;

XSendEvent(disp, window(), False, StructureNotifyMask, &event); +} + +bool WinClient::acceptsFocus() const { + return (m_focus_mode == F_LOCALLYACTIVE || + m_focus_mode == F_PASSIVE || + m_focus_mode == F_GLOBALLYACTIVE && send_focus_message); } bool WinClient::sendFocus() {
M src/WinClient.hhsrc/WinClient.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WinClient.hh,v 1.16 2003/12/17 01:20:49 fluxgen Exp $ +// $Id: WinClient.hh,v 1.17 2004/04/28 14:59:12 rathnor Exp $ #ifndef WINCLIENT_HH #define WINCLIENT_HH

@@ -54,6 +54,7 @@ void updateRect(int x, int y, unsigned int width, unsigned int height);

bool sendFocus(); // returns whether we sent a message or not // i.e. whether we assume the focus will get taken + bool acceptsFocus() const; // will this window accept focus (according to hints) void sendClose(bool forceful = false); // not aware of anything that makes this false at present inline bool isClosable() const { return true; }
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WorkspaceCmd.cc,v 1.10 2004/01/16 09:21:31 fluxgen Exp $ +// $Id: WorkspaceCmd.cc,v 1.11 2004/04/28 14:59:12 rathnor Exp $ #include "WorkspaceCmd.hh"

@@ -28,6 +28,7 @@ #include "Workspace.hh"

#include "Window.hh" #include "Screen.hh" #include "fluxbox.hh" +#include "WinClient.hh" #include "FbTk/KeyUtil.hh"

@@ -77,6 +78,18 @@ }

} else screen->nextFocus(m_option); } +} + +void DirFocusCmd::execute() { + BScreen *screen = Fluxbox::instance()->keyScreen(); + if (screen == 0) + return; + + WinClient *client = Fluxbox::instance()->getFocusedWindow(); + if (client == 0 || client->fbwindow() == 0) + return; + + screen->dirFocus(*client->fbwindow(), m_dir); } void NextWorkspaceCmd::execute() {
M src/WorkspaceCmd.hhsrc/WorkspaceCmd.hh

@@ -20,11 +20,12 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WorkspaceCmd.hh,v 1.2 2003/07/01 09:47:41 fluxgen Exp $ +// $Id: WorkspaceCmd.hh,v 1.3 2004/04/28 14:59:12 rathnor Exp $ #ifndef WORKSPACECMD_HH #define WORKSPACECMD_HH #include "Command.hh" +#include "Screen.hh" class NextWindowCmd: public FbTk::Command { public:

@@ -40,6 +41,14 @@ explicit PrevWindowCmd(int option):m_option(option) { }

void execute(); private: const int m_option; +}; + +class DirFocusCmd: public FbTk::Command { +public: + explicit DirFocusCmd(const BScreen::FocusDir dir): m_dir(dir) { } + void execute(); +private: + const BScreen::FocusDir m_dir; }; class NextWorkspaceCmd: public FbTk::Command {