summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-20 08:36:06 +0000
committerDana Jansens <danakj@orodu.net>2002-07-20 08:36:06 +0000
commitb790e78e0ac99d3bcdc3f7e11b43e4da1ede8968 (patch)
tree9b18d99324a9f7fa37e180678dcf5f8b24690f29 /util
parent8ec56b9907d7fafab28e79cab362a43f2971ab72 (diff)
make the returned action list a const reference
Diffstat (limited to 'util')
-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;
+ }
+ }
}
}
}