summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-20 10:03:42 +0000
committerDana Jansens <danakj@orodu.net>2002-07-20 10:03:42 +0000
commit348c8bff112604da741b0e109bda9b5af7672db4 (patch)
tree6823b7160783e010c8232c55b7a9c8d64cab8043
parenta9dfa0439bd8d4f525d5b41a22a3eb14b94d1200 (diff)
add cycling of next/prev window of class
-rw-r--r--util/epist/actions.hh4
-rw-r--r--util/epist/screen.cc19
-rw-r--r--util/epist/screen.hh3
3 files changed, 19 insertions, 7 deletions
diff --git a/util/epist/actions.hh b/util/epist/actions.hh
index 0588692d..0d3e572b 100644
--- a/util/epist/actions.hh
+++ b/util/epist/actions.hh
@@ -50,8 +50,8 @@ public:
nextWindowOnAllWorkspaces, //done
prevWindowOnAllWorkspaces, //done
- nextWindowOfClass,
- prevWindowOfClass,
+ nextWindowOfClass, //done
+ prevWindowOfClass, //done
changeWorkspace, //done
nextWorkspace, //done
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index 72ee3435..422ec056 100644
--- a/util/epist/screen.cc
+++ b/util/epist/screen.cc
@@ -164,11 +164,11 @@ void screen::handleKeypress(const XEvent &e) {
return;
case Action::nextWindow:
- cycleWindow(true, false);
+ cycleWindow(true);
return;
case Action::prevWindow:
- cycleWindow(false, false);
+ cycleWindow(false);
return;
case Action::nextWindowOnAllWorkspaces:
@@ -179,6 +179,14 @@ void screen::handleKeypress(const XEvent &e) {
cycleWindow(false, true);
return;
+ case Action::nextWindowOfClass:
+ cycleWindow(true, false, true);
+ return;
+
+ case Action::prevWindowOfClass:
+ cycleWindow(false, false, true);
+ return;
+
case Action::changeWorkspace:
changeWorkspace(it->number());
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);
if (_clients.empty()) return;
@@ -354,7 +363,9 @@ void screen::cycleWindow(const bool forward, const bool alldesktops) const {
}
} 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();
diff --git a/util/epist/screen.hh b/util/epist/screen.hh
index af5c00d1..7e2e880d 100644
--- a/util/epist/screen.hh
+++ b/util/epist/screen.hh
@@ -70,7 +70,8 @@ public:
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;