add cycling of next/prev window of class

This commit is contained in:
Dana Jansens 2002-07-20 10:03:42 +00:00
parent a9dfa0439b
commit 348c8bff11
3 changed files with 19 additions and 7 deletions

View file

@ -50,8 +50,8 @@ public:
nextWindowOnAllWorkspaces, //done nextWindowOnAllWorkspaces, //done
prevWindowOnAllWorkspaces, //done prevWindowOnAllWorkspaces, //done
nextWindowOfClass, nextWindowOfClass, //done
prevWindowOfClass, prevWindowOfClass, //done
changeWorkspace, //done changeWorkspace, //done
nextWorkspace, //done nextWorkspace, //done

View file

@ -164,11 +164,11 @@ void screen::handleKeypress(const XEvent &e) {
return; return;
case Action::nextWindow: case Action::nextWindow:
cycleWindow(true, false); cycleWindow(true);
return; return;
case Action::prevWindow: case Action::prevWindow:
cycleWindow(false, false); cycleWindow(false);
return; return;
case Action::nextWindowOnAllWorkspaces: case Action::nextWindowOnAllWorkspaces:
@ -179,6 +179,14 @@ void screen::handleKeypress(const XEvent &e) {
cycleWindow(false, true); cycleWindow(false, true);
return; return;
case Action::nextWindowOfClass:
cycleWindow(true, false, true);
return;
case Action::prevWindowOfClass:
cycleWindow(false, false, true);
return;
case Action::changeWorkspace: case Action::changeWorkspace:
changeWorkspace(it->number()); changeWorkspace(it->number());
return; return;
@ -332,7 +340,8 @@ void screen::updateActiveWindow() {
*/ */
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); assert(_managed);
if (_clients.empty()) return; if (_clients.empty()) return;
@ -354,7 +363,9 @@ void screen::cycleWindow(const bool forward, const bool alldesktops) const {
} }
} while (target == _clients.end() || } while (target == _clients.end() ||
(*target)->iconic() || (*target)->iconic() ||
(! alldesktops && (*target)->desktop() != _active_desktop)); (! alldesktops && (*target)->desktop() != _active_desktop) ||
(sameclass && _active != _clients.end() &&
(*target)->appClass() != (*_active)->appClass()));
if (target != _clients.end()) if (target != _clients.end())
(*target)->focus(); (*target)->focus();

View file

@ -70,7 +70,8 @@ public:
void handleKeypress(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 cycleWorkspace(const bool forward, const bool loop = true) const;
void changeWorkspace(const int num) const; void changeWorkspace(const int num) const;
void toggleShaded(const Window win) const; void toggleShaded(const Window win) const;