aboutsummaryrefslogtreecommitdiffstats
path: root/xevents.c
diff options
context:
space:
mode:
authorokan2017-12-29 18:50:43 +0000
committerokan2017-12-29 18:50:43 +0000
commit94fa8f6008663944358afaeb58a1217cf564a95c (patch)
tree4bdd8f886ccf464e30724d945a5843cbdfbc9bb7 /xevents.c
parent2752425282f3222e609d25dee2df4f4d666274d5 (diff)
downloadcwm-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 'xevents.c')
-rw-r--r--xevents.c15
1 files changed, 13 insertions, 2 deletions
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;
}
}