Set XCB as event queue owner (following http://xcb.freedesktop.org/MixingCalls).
Add missing code to initialize client window ID before xcb_create_window() call.
Update some log messages.
Remove event poll after window creation. Let NestedClientCheckEvents() handle all events.
Change event poll loop to look closer Xephyr way to do it.
Change way to initialize KeySyms map in NestedClientGetKeyboardMappings() function to avoid memory leaks.
Increment allocated memory to avoid leaks in _nested_input_init_buttons() function.