From a4a4ae00216838145c05fd84c5900fdc8867c99c Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 13 Jan 2013 13:55:12 +0000 Subject: put back r1.68 which allows an empty group to be sticky; behavior change noticed by Thomas Pfaff and diagnosis why we need to group_setactive in this case by Alexander Polakov. replace XXX with a useful comment. --- group.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'group.c') diff --git a/group.c b/group.c index 5a75bff..8cde005 100644 --- a/group.c +++ b/group.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: group.c,v 1.69 2013/01/10 15:28:11 okan Exp $ + * $OpenBSD: group.c,v 1.70 2013/01/13 13:55:12 okan Exp $ */ #include @@ -269,8 +269,12 @@ group_hidetoggle(struct screen_ctx *sc, int idx) if (gc->hidden) group_show(sc, gc); - else + else { group_hide(sc, gc); + /* make clients stick to empty group */ + if (TAILQ_EMPTY(&gc->clients)) + group_setactive(sc, idx); + } } void -- cgit v1.2.3-2-gb3c3