From b790e78e0ac99d3bcdc3f7e11b43e4da1ede8968 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 20 Jul 2002 08:36:06 +0000 Subject: [PATCH] make the returned action list a const reference --- util/epist/epist.hh | 2 +- util/epist/screen.cc | 21 +++++++++++++-------- 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; + } + } } } } -- 2.45.2