summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/epist/epist.hh2
-rw-r--r--util/epist/screen.cc21
2 files changed, 14 insertions, 9 deletions
diff --git a/util/epist/epist.hh b/util/epist/epist.hh
index a3c4fdcc..ceaebdfa 100644
--- a/util/epist/epist.hh
+++ b/util/epist/epist.hh
@@ -67,7 +67,7 @@ public:
void removeWindow(XWindow *window);
XWindow *findWindow(Window window) const;
- const ActionList actions(void) { return _actions; }
+ const ActionList &actions(void) { return _actions; }
};
#endif // __epist_hh
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index 0d7f90d3..475a96e2 100644
--- a/util/epist/screen.cc
+++ b/util/epist/screen.cc
@@ -151,22 +151,27 @@ void screen::handleKeypress(const XEvent &e) {
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;
+ }
+ }
}
}
}