X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fscreen.cc;h=475a96e20f95581b766e4aec3f44ece9e3580ccf;hb=8e601e4a64b37f333fc3a5f844e4d72d6f289415;hp=0d7f90d3d46907a0104e93f0c0f2da17d9a8d783;hpb=f693859b3e539527afa2bd65d615bad8402a1e55;p=chaz%2Fopenbox 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; + } + } } } }