]> Dogcows Code - chaz/openbox/blobdiff - util/epist/screen.cc
line up the vars
[chaz/openbox] / util / epist / screen.cc
index fd65db4c5e6796f8a1ac9a688ee50a486b5819d9..475a96e20f95581b766e4aec3f44ece9e3580ccf 100644 (file)
@@ -145,29 +145,33 @@ void screen::processEvent(const XEvent &e) {
 void screen::handleKeypress(const XEvent &e) {
   ActionList::const_iterator it = _epist->actions().begin();
   ActionList::const_iterator end = _epist->actions().end();
-  cout << "key press\n";
   for (; it != end; ++it) {
     if (e.xkey.keycode == it->keycode() &&
         e.xkey.state == it->modifierMask()) {
       switch (it->type()) {
       case Action::nextWorkspace:
         cycleWorkspace(true);
-        break;
+        return;
 
       case Action::prevWorkspace:
         cycleWorkspace(false);
-        break;
+        return;
 
       case Action::changeWorkspace:
         changeWorkspace(it->number());
-        break;
-
-      case Action::shade:
-        (*_active)->shade(! (*_active)->shaded());
-        break;
+        return;
       }
 
-      break;
+      // these actions require an active window
+      if (_active != _clients.end()) {
+        XWindow *window = *_active;
+
+        switch (it->type()) {
+        case Action::shade:
+          window->shade(! window->shaded());
+          return;
+        }
+      }
     }
   }
 }
This page took 0.02038 seconds and 4 git commands to generate.