Fix possible deadlock during startup
commit9b7873392228e8ebab407144f1aacaead4f9733d
authorUli Schlachter <psychon@znc.in>
Fri, 4 Oct 2013 08:01:03 +0000 (4 10:01 +0200)
committerUli Schlachter <psychon@znc.in>
Fri, 4 Oct 2013 08:01:03 +0000 (4 10:01 +0200)
tree336d5cf9488c6235b25a4b8e5bec68887e4f575e
parent8792d6a4ba3577de79d5cfb0ef738b64424e4552
Fix possible deadlock during startup

For setting up the wallpaper, awesome needs a second connection to the X11
server (isn't SetCloseDownMode just great?).

However, it was possible to have a dead-lock with our main connection due to
this. Awesome does a GrabServer during startup so that nothing else can use the
X11 server while we set ourselves up. The server is ungrabbed right before the
lua config is read. However, nothing makes sure that this ungrab request really
is sent to the server instead of just waiting in xcb's output buffer.

The dead-lock would now happen if we try to establish a second connection to the
X11 server before the ungrab request was flushed on the main connection. The
server will wait for the ungrab on the first connection, awesome is waiting for
the second connection to be successfully established.

Fix this by making sure the UngrabServer request is flushed before parsing the
config file.

Signed-off-by: Uli Schlachter <psychon@znc.in>
awesome.c