aboutsummaryrefslogtreecommitdiffstats
path: root/group.c
diff options
context:
space:
mode:
authorokan2011-09-19 07:23:03 +0000
committerokan2011-09-19 07:23:03 +0000
commit142e82d1820534d8206e40d214b13116da3d4673 (patch)
treebd9cd346b5d7d08f27af51c58aaf9363e6ef7555 /group.c
parenta1dfc89bc5127fb8822720dee13c1e5e542602b4 (diff)
downloadcwm-142e82d1820534d8206e40d214b13116da3d4673.tar.gz
move client to group (movetogroup) and hide client only if group is
already hidden (suggested behavior from Alexander Polakov). ok sthen oga
Diffstat (limited to 'group.c')
-rw-r--r--group.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/group.c b/group.c
index f1acf19..1c2f292 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.52 2011/09/13 08:37:49 okan Exp $
+ * $OpenBSD: group.c,v 1.53 2011/09/19 07:23:03 okan Exp $
*/
#include <sys/param.h>
@@ -216,12 +216,16 @@ void
group_movetogroup(struct client_ctx *cc, int idx)
{
struct screen_ctx *sc = cc->sc;
+ struct group_ctx *gc;
if (idx < 0 || idx >= CALMWM_NGROUPS)
err(1, "group_movetogroup: index out of range (%d)", idx);
- if(sc->group_active != &sc->groups[idx])
+ gc = &sc->groups[idx];
+ if (gc->hidden) {
client_hide(cc);
+ gc->nhidden++;
+ }
group_add(&sc->groups[idx], cc);
}