Some WM send a WM_TAKE_FOCUS event before the window is really mapped (for example, change from virtual desktop), because of this, the call to XSetInputFocus fail and close Blender.