Ungrab the server before parsing the config
commit092813cd63828023a5474e479b3ade8a703262ee
authorUli Schlachter <psychon@znc.in>
Wed, 19 Oct 2011 13:11:11 +0000 (19 15:11 +0200)
committerJulien Danjou <julien@danjou.info>
Fri, 21 Oct 2011 15:08:39 +0000 (21 17:08 +0200)
treee4b83ebde2c86534eaae098d47a3e4c18b25025a
parent0e44a6282ed4d0e81f83dbce28e9ccd5a481804e
Ungrab the server before parsing the config

This moves the loading of the rc.lua and managing of pre-existing clients to
after we ungrab the server during startup. To make sure we have no races with
clients which start up parallel to awesome, we do the QueryTree for all the
clients that we have to manage before the ungrab, but start managing the clients
only after the ungrab.

This means that we have already selected our event mask on the root window in
scan() and thus received an UnmapNotify event when we reparent windows into a
frame window. This has the effect that we immediately unmanage the client again,
whoops.

To fix this, we grab the server again and remove our event mask on the root
window again while we reparent.

This should hopefully fix all cases where we deadlock during startup because
pulseaudio wants to talk to the X server, but is being ignored because we have
the server grabbed while at the same time we are waiting for pulseaudio.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
awesome.c