all repos — openbox @ b790e78e0ac99d3bcdc3f7e11b43e4da1ede8968

openbox fork - make it a bit more like ryudo

make the returned action list a const reference
Dana Jansens danakj@orodu.net
commit

b790e78e0ac99d3bcdc3f7e11b43e4da1ede8968

parent

8ec56b9907d7fafab28e79cab362a43f2971ab72

2 files changed, 14 insertions(+), 9 deletions(-)

jump to
M util/epist/epist.hhutil/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.ccutil/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; } } }