diff options
author | okan | 2017-12-29 18:50:43 +0000 |
---|---|---|
committer | okan | 2017-12-29 18:50:43 +0000 |
commit | 94fa8f6008663944358afaeb58a1217cf564a95c (patch) | |
tree | 4bdd8f886ccf464e30724d945a5843cbdfbc9bb7 /xevents.c | |
parent | 2752425282f3222e609d25dee2df4f4d666274d5 (diff) | |
download | cwm-94fa8f6008663944358afaeb58a1217cf564a95c.tar.gz |
As done for buttonrelease, work specific un-cycling and un-highlighting actions
into the keyrelease event, only performing what's actually needed for each;
should result in much fewer events against keyreleases. No intended behaviour
change.
Additionally, like we do for group membership, grab the keyboard only when
required for cycling.
Diffstat (limited to '')
-rw-r--r-- | xevents.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xevents.c,v 1.131 2017/12/29 16:55:50 okan Exp $ + * $OpenBSD: xevents.c,v 1.132 2017/12/29 18:50:43 okan Exp $ */ /* @@ -324,6 +324,7 @@ xev_handle_keyrelease(XEvent *ee) { XKeyEvent *e = &ee->xkey; struct screen_ctx *sc; + struct client_ctx *cc; KeySym keysym; unsigned int i; @@ -333,7 +334,17 @@ xev_handle_keyrelease(XEvent *ee) keysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 0); for (i = 0; i < nitems(modkeys); i++) { if (keysym == modkeys[i]) { - client_cycle_leave(sc); + if ((cc = client_current()) != NULL) { + if (sc->cycling) { + sc->cycling = 0; + client_mtf(cc); + } + if (cc->flags & CLIENT_HIGHLIGHT) { + cc->flags &= ~CLIENT_HIGHLIGHT; + client_draw_border(cc); + } + } + XUngrabKeyboard(X_Dpy, CurrentTime); break; } } |