From 4e73ce533c98c54a83fa24c71105bbb1b40a0803 Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 27 Feb 2022 14:59:55 +0000 Subject: cycling fix: when no client is active, warp pointer to last active; from Walter Alejandro Iglesias. --- kbfunc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kbfunc.c b/kbfunc.c index 2f8d95d..f805360 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -450,7 +450,16 @@ kbfunc_client_cycle(void *ctx, struct cargs *cargs) newcc->ptr.x = newcc->geom.w / 2; newcc->ptr.y = newcc->geom.h / 2; } - client_ptr_warp(newcc); + + /* When no client is active, warp pointer to last active. */ + if (oldcc->flags & (CLIENT_ACTIVE)) + client_ptr_warp(newcc); + else if (oldcc->flags & (CLIENT_SKIP_CYCLE)) + client_ptr_warp(newcc); + else { + client_raise(oldcc); + client_ptr_warp(oldcc); + } } void -- cgit 1.4.1