add cycling of next/prev window of class
Dana Jansens danakj@orodu.net
3 files changed,
19 insertions(+),
7 deletions(-)
M
util/epist/actions.hh
→
util/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.cc
→
util/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.hh
→
util/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;