all repos — openbox @ 348c8bff112604da741b0e109bda9b5af7672db4

openbox fork - make it a bit more like ryudo

add cycling of next/prev window of class
Dana Jansens danakj@orodu.net
commit

348c8bff112604da741b0e109bda9b5af7672db4

parent

a9dfa0439bd8d4f525d5b41a22a3eb14b94d1200

3 files changed, 19 insertions(+), 7 deletions(-)

jump to
M util/epist/actions.hhutil/epist/actions.hh

@@ -50,8 +50,8 @@ prevWindow, //done for now

nextWindowOnAllWorkspaces, //done prevWindowOnAllWorkspaces, //done - nextWindowOfClass, - prevWindowOfClass, + nextWindowOfClass, //done + prevWindowOfClass, //done changeWorkspace, //done nextWorkspace, //done
M util/epist/screen.ccutil/epist/screen.cc

@@ -164,11 +164,11 @@ cycleWorkspace(false);

return; case Action::nextWindow: - cycleWindow(true, false); + cycleWindow(true); return; case Action::prevWindow: - cycleWindow(false, false); + cycleWindow(false); return; case Action::nextWindowOnAllWorkspaces:

@@ -177,6 +177,14 @@ return;

case Action::prevWindowOnAllWorkspaces: cycleWindow(false, true); + return; + + case Action::nextWindowOfClass: + cycleWindow(true, false, true); + return; + + case Action::prevWindowOfClass: + cycleWindow(false, false, true); return; case Action::changeWorkspace:

@@ -332,7 +340,8 @@ }

*/ -void screen::cycleWindow(const bool forward, const bool alldesktops) const { +void screen::cycleWindow(const bool forward, const bool alldesktops, + const bool sameclass) const { assert(_managed); if (_clients.empty()) return;

@@ -354,7 +363,9 @@ --target;

} } while (target == _clients.end() || (*target)->iconic() || - (! alldesktops && (*target)->desktop() != _active_desktop)); + (! alldesktops && (*target)->desktop() != _active_desktop) || + (sameclass && _active != _clients.end() && + (*target)->appClass() != (*_active)->appClass())); if (target != _clients.end()) (*target)->focus();
M util/epist/screen.hhutil/epist/screen.hh

@@ -70,7 +70,8 @@ void processEvent(const XEvent &e);

void handleKeypress(const XEvent &e); - void cycleWindow(const bool forward, const bool alldesktops) const; + void cycleWindow(const bool forward, const bool alldesktops = false, + const bool sameclass = false) const; void cycleWorkspace(const bool forward, const bool loop = true) const; void changeWorkspace(const int num) const; void toggleShaded(const Window win) const;