]> Dogcows Code - chaz/openbox/blobdiff - util/epist/screen.cc
rename the sendTo action to sendToWorkspace
[chaz/openbox] / util / epist / screen.cc
index c7c2a42d53affd49c81f421d3a90acdfec55f5ee..db100889fb64e97b1182300f6d424494a16893c2 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,22 @@ 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::nextWindowOfClassOnAllWorkspaces:
+        cycleWindow(true, true, true);
+        return;
+
+      case Action::prevWindowOfClassOnAllWorkspaces:
+        cycleWindow(false, true, true);
+        return;
+
       case Action::changeWorkspace:
         changeWorkspace(it->number());
         return;
@@ -205,6 +221,17 @@ void screen::handleKeypress(const XEvent &e) {
           window->lower();
           return;
 
+        case Action::sendToWorkspace:
+          window->sendTo(it->number());
+          return;
+
+        case Action::toggleomnipresent:
+          if (window->desktop() == 0xffffffff)
+            window->sendTo(_active_desktop);
+          else
+            window->sendTo(0xffffffff);
+          return;
+
         case Action::toggleshade:
           window->shade(! window->shaded());
           return;
@@ -332,7 +359,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,18 +382,12 @@ 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()) {
-    if ((*target)->desktop() != _active_desktop)
-      changeWorkspace((*target)->desktop());
-
-    // we dont send an ACTIVE_WINDOW client message because that would also
-    // unshade the window if it was shaded
-    XSetInputFocus(_epist->getXDisplay(), (*target)->window(), RevertToNone,
-                   CurrentTime);
-    XRaiseWindow(_epist->getXDisplay(), (*target)->window());
-  }
+  if (target != _clients.end())
+    (*target)->focus();
 }
 
 
This page took 0.024887 seconds and 4 git commands to generate.