Ungrab the server before parsing the config
commitbf76b3842b92922b8d3fa23a105d9e9b1aad521c
authorUli Schlachter <psychon@znc.in>
Wed, 19 Oct 2011 13:11:11 +0000 (19 15:11 +0200)
committerUli Schlachter <psychon@znc.in>
Wed, 19 Oct 2011 13:11:11 +0000 (19 15:11 +0200)
treead0d1e70c54a0e29cceba2beaad1fd2d110a4abc
parent1801a8be46237576f0a274fe6ef46f529068e220
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>
awesome.c
objects/client.c