From 0884d38e3b1e458d4b247db358e8b5238b0d5774 Mon Sep 17 00:00:00 2001 From: tedu Date: Sun, 13 Feb 2011 17:25:20 +0000 Subject: [PATCH 1/2] we lose track of highstack somewhere, so recompute it before we need it. fixes a crash reported by christian neukirchen. ok okan --- group.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/group.c b/group.c index 1c2fd03..544207f 100644 --- a/group.c +++ b/group.c @@ -108,6 +108,11 @@ group_show(struct screen_ctx *sc, struct group_ctx *gc) u_int i; int lastempty = -1; + gc->highstack = 0; + TAILQ_FOREACH(cc, &gc->clients, group_entry) { + if (cc->stackingorder > gc->highstack) + gc->highstack = cc->stackingorder; + } winlist = (Window *) xcalloc(sizeof(*winlist), (gc->highstack + 1)); /* From 64e62989d01a1a14065ec220362dd67e85ce0b94 Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 13 Feb 2011 20:09:57 +0000 Subject: [PATCH 2/2] if we are saving the pointer location for a specific client, make sure that if it is not already inbounds, put it in the default location, which happens to be inbounds. behavior noticed by Thomas Pfaff while maximizing and un-maximizing a window, leaving the pointer behind and causing client_cycle() to be a bit lost. ok oga@ --- client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.c b/client.c index 95d9d75..8971b35 100644 --- a/client.c +++ b/client.c @@ -435,6 +435,9 @@ client_ptrsave(struct client_ctx *cc) if (client_inbound(cc, x, y)) { cc->ptr.x = x; cc->ptr.y = y; + } else { + cc->ptr.x = -1; + cc->ptr.y = -1; } }