From 94fa8f6008663944358afaeb58a1217cf564a95c Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 29 Dec 2017 18:50:43 +0000 Subject: 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. --- xevents.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'xevents.c') diff --git a/xevents.c b/xevents.c index aa9856b..61fe476 100644 --- a/xevents.c +++ b/xevents.c @@ -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; } } -- cgit v1.2.3-2-gb3c3