diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2022-02-27 14:59:56 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2022-02-27 14:59:56 +0000 |
commit | 55f62b92a280c019ada0ddfc224c04072c6eba45 (patch) | |
tree | 24df984057a6ebdd7c1b9e717eb4b164a500f60e /app/cwm | |
parent | 2849e3e6a44801e3b3325f8d118aad91282bf73e (diff) |
cycling fix: when no client is active, warp pointer to last active;
from Walter Alejandro Iglesias.
Diffstat (limited to 'app/cwm')
-rw-r--r-- | app/cwm/kbfunc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 9a943df61..6cc4a6fe3 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.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: kbfunc.c,v 1.172 2022/02/26 15:19:18 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.173 2022/02/27 14:59:55 okan Exp $ */ #include <sys/types.h> @@ -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 |