This should all be done in the CWinEventsX11Imp constructor.