grab server on initialization

That allows to not miss any window on startup.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-09-10 16:06:32 +02:00
parent 9e426be091
commit 803d837d88
1 changed files with 6 additions and 0 deletions

View File

@ -384,6 +384,9 @@ main(int argc, char **argv)
if(xcb_connection_has_error(globalconf.connection))
fatal("cannot open display");
/* Grab server */
xcb_grab_server(globalconf.connection);
/* Get the file descriptor corresponding to the X connection */
xfd = xcb_get_file_descriptor(globalconf.connection);
ev_io_init(&xio, &a_xcb_io_cb, xfd, EV_READ);
@ -509,6 +512,9 @@ main(int argc, char **argv)
/* refresh everything before waiting events */
awesome_refresh(globalconf.connection);
/* Grab server */
xcb_ungrab_server(globalconf.connection);
/* main event loop */
ev_loop(globalconf.loop, 0);