Fixes race condition
XSelectInput must be called before XMapRaised.