aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorokan2016-10-06 14:30:05 +0000
committerokan2016-10-06 14:30:05 +0000
commit97f575bc42f2f8f9458adf55d1fc29e8bd021c83 (patch)
treeb5696737272199f7b269d9fe2d600fece5dc4d97 /client.c
parent931705f1ef0f632addc53c7907152ff9cf0f8e8b (diff)
downloadcwm-97f575bc42f2f8f9458adf55d1fc29e8bd021c83.tar.gz
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.
Diffstat (limited to '')
-rw-r--r--client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/client.c b/client.c
index 9644a98..978934d 100644
--- a/client.c
+++ b/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 <sys/types.h>
@@ -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);
}