make the returned action list a const reference
Dana Jansens danakj@orodu.net
2 files changed,
14 insertions(+),
9 deletions(-)
M
util/epist/epist.hh
→
util/epist/epist.hh
@@ -67,7 +67,7 @@ void addWindow(XWindow *window);
void removeWindow(XWindow *window); XWindow *findWindow(Window window) const; - const ActionList actions(void) { return _actions; } + const ActionList &actions(void) { return _actions; } }; #endif // __epist_hh
M
util/epist/screen.cc
→
util/epist/screen.cc
@@ -151,22 +151,27 @@ 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; + return; + } + + // these actions require an active window + if (_active != _clients.end()) { + XWindow *window = *_active; - case Action::shade: - (*_active)->shade(! (*_active)->shaded()); - break; + switch (it->type()) { + case Action::shade: + window->shade(! window->shaded()); + return; + } } - - break; } } }