From: Dana Jansens Date: Sat, 20 Jul 2002 08:36:06 +0000 (+0000) Subject: make the returned action list a const reference X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=b790e78e0ac99d3bcdc3f7e11b43e4da1ede8968;p=chaz%2Fopenbox make the returned action list a const reference --- 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; + } + } } } }