aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2011-12-29 20:48:38 +0000
committerokan2011-12-29 20:48:38 +0000
commitadc8c1f0f79042f952d99bdbf88392009a688abc (patch)
treeac558be4bb150360fea7cdacdec08f40de6be10b
parentb09d520ac0fcab47e5b2f2fc572550e075cc3187 (diff)
downloadcwm-adc8c1f0f79042f952d99bdbf88392009a688abc.tar.gz
check if we're in the group already, else multiple calls to
group_movetogroup() on one client will still increment nhidden if the group is hidden. found the hard way by Thomas Jeunet and fix from Alexander Polakov - thanks to both! ok oga@
Diffstat (limited to '')
-rw-r--r--group.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/group.c b/group.c
index a38a005..17de904 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.54 2011/10/12 15:43:50 okan Exp $
+ * $OpenBSD: group.c,v 1.55 2011/12/29 20:48:38 okan Exp $
*/
#include <sys/param.h>
@@ -222,11 +222,13 @@ group_movetogroup(struct client_ctx *cc, int idx)
err(1, "group_movetogroup: index out of range (%d)", idx);
gc = &sc->groups[idx];
+ if (cc->group == gc)
+ return;
if (gc->hidden) {
client_hide(cc);
gc->nhidden++;
}
- group_add(&sc->groups[idx], cc);
+ group_add(gc, cc);
}
/*