]> Dogcows Code - chaz/openbox/commitdiff
add cycling of next/prev window of class
authorDana Jansens <danakj@orodu.net>
Sat, 20 Jul 2002 10:03:42 +0000 (10:03 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 20 Jul 2002 10:03:42 +0000 (10:03 +0000)
util/epist/actions.hh
util/epist/screen.cc
util/epist/screen.hh

index 0588692d64de549bcddeca6c394aca2d7a5e0871..0d3e572b06ff7816d13882c08d8d5b96ef3e5cdb 100644 (file)
@@ -50,8 +50,8 @@ public:
     nextWindowOnAllWorkspaces, //done
     prevWindowOnAllWorkspaces, //done
 
-    nextWindowOfClass,
-    prevWindowOfClass,
+    nextWindowOfClass, //done
+    prevWindowOfClass, //done
 
     changeWorkspace, //done
     nextWorkspace, //done
index 72ee34352dea39616dea96de51902664a0ec68fa..422ec056b0c97a1946bab5ea5fc4e30e2799206d 100644 (file)
@@ -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();
index af5c00d1459f6fccd71ef26a49bdd74c338e1b87..7e2e880dd1e8e98b65adeb9534ad49fc8d080ce4 100644 (file)
@@ -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;
This page took 0.026385 seconds and 4 git commands to generate.