From 5146f661bd970ea1aa7e05b3647bd9dc8a555a81 Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 23 Jan 2015 19:35:11 +0000 Subject: [PATCH 1/2] First restore net_wm_state(ewmh), then wm_state(iccc); prevents clients from re-hiding on restart due to flag toggling (note that this is ripe for re-vamping). Behavior only observed on restarts. Problem found by, and initial patch from, Henri Kemppainen (thanks!), though ever so slightly different one applied. --- client.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client.c b/client.c index f6aa714..5e9a267 100644 --- a/client.c +++ b/client.c @@ -63,7 +63,6 @@ client_init(Window win, struct screen_ctx *sc) { struct client_ctx *cc; XWindowAttributes wattr; - long state; int mapped; if (win == None) @@ -125,16 +124,16 @@ client_init(Window win, struct screen_ctx *sc) /* Notify client of its configuration. */ client_config(cc); - if ((state = client_get_wm_state(cc)) < 0) - state = NormalState; - - (state == IconicState) ? client_hide(cc) : client_unhide(cc); - TAILQ_INSERT_TAIL(&sc->clientq, cc, entry); xu_ewmh_net_client_list(sc); xu_ewmh_restore_net_wm_state(cc); + if (client_get_wm_state(cc) == IconicState) + client_hide(cc); + else + client_unhide(cc); + if (mapped) group_autogroup(cc); From d8fa58bb6256d5a499d7cd957b95b5b052cf16a2 Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 23 Jan 2015 20:26:36 +0000 Subject: [PATCH 2/2] use malloc over calloc here --- conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.c b/conf.c index 8eec4a3..1c75285 100644 --- a/conf.c +++ b/conf.c @@ -96,7 +96,7 @@ conf_ignore(struct conf *c, const char *name) { struct winname *wn; - wn = xcalloc(1, sizeof(*wn)); + wn = xmalloc(sizeof(*wn)); wn->name = xstrdup(name); TAILQ_INSERT_TAIL(&c->ignoreq, wn, entry); }