aboutsummaryrefslogtreecommitdiffstats
path: root/group.c
diff options
context:
space:
mode:
authorokan2014-08-25 14:31:22 +0000
committerokan2014-08-25 14:31:22 +0000
commit65f7d6fe84c11c78932bd9c10bce0ed3ded143c8 (patch)
tree46450ff078a2e29d5d813fa95d9d652bff9dcb14 /group.c
parent69a4c46eec5a14a1d2e31092a91056655acdf8d5 (diff)
downloadcwm-65f7d6fe84c11c78932bd9c10bce0ed3ded143c8.tar.gz
Since the flatting out of sc->group_names is only for setting
NET_DESKTOP_NAMES, merge the helper into xu_ewmh_net_desktop_names, where we actually set the property.
Diffstat (limited to 'group.c')
-rw-r--r--group.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/group.c b/group.c
index 473aff8..d73a71b 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.95 2014/08/25 12:49:19 okan Exp $
+ * $OpenBSD: group.c,v 1.96 2014/08/25 14:31:22 okan Exp $
*/
#include <sys/param.h>
@@ -38,7 +38,6 @@ static void group_show(struct screen_ctx *, struct group_ctx *);
static void group_restack(struct screen_ctx *, struct group_ctx *);
static int group_hidden_state(struct group_ctx *);
static void group_setactive(struct screen_ctx *, long);
-static void group_set_names(struct screen_ctx *);
const char *num_to_name[] = {
"nogroup", "one", "two", "three", "four", "five", "six",
@@ -427,28 +426,7 @@ group_update_names(struct screen_ctx *sc)
sc->group_names = strings;
sc->group_nonames = n;
- if (setnames)
- group_set_names(sc);
-}
-static void
-group_set_names(struct screen_ctx *sc)
-{
- char *p, *q;
- size_t len = 0, tlen, slen;
- int i;
-
- for (i = 0; i < sc->group_nonames; i++)
- len += strlen(sc->group_names[i]) + 1;
- q = p = xcalloc(len, sizeof(*p));
-
- tlen = len;
- for (i = 0; i < sc->group_nonames; i++) {
- slen = strlen(sc->group_names[i]) + 1;
- (void)strlcpy(q, sc->group_names[i], tlen);
- tlen -= slen;
- q += slen;
- }
-
- xu_ewmh_net_desktop_names(sc, p, len);
+ if (setnames)
+ xu_ewmh_net_desktop_names(sc);
}