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.
This commit is contained in:
okan 2015-01-23 19:35:11 +00:00
parent 7936b9b2a7
commit 5146f661bd

View File

@ -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);