From 55c8a476e498a737da657d99d0287d759f8b7420 Mon Sep 17 00:00:00 2001 From: Okan Demirmen Date: Thu, 6 Oct 2016 14:30:06 +0000 Subject: Check the ptr bounds in the new client during cycling, since not all actions do ptrsave, such as restoring client geometry; adapted from a diff by Vadim Vygonets. --- app/cwm/client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/cwm/client.c b/app/cwm/client.c index 9644a982c..978934d94 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.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: client.c,v 1.228 2016/10/04 15:52:32 okan Exp $ + * $OpenBSD: client.c,v 1.229 2016/10/06 14:30:05 okan Exp $ */ #include @@ -683,6 +683,10 @@ client_cycle(struct screen_ctx *sc, int flags) sc->cycling = 1; client_ptrsave(oldcc); client_raise(newcc); + if (!client_inbound(newcc, newcc->ptr.x, newcc->ptr.y)) { + newcc->ptr.x = newcc->geom.w / 2; + newcc->ptr.y = newcc->geom.h / 2; + } client_ptrwarp(newcc); } -- cgit v1.2.3