Revert recent XIM fixes from !236
This commit causes a regression, see #205 (closed), #206 (closed), #207 (closed), #208 (closed)
This reverts commit 041b5291 and 024d229f.
Same as !247 (closed) but the commit message has reference to the bugs the future.
I'm going to merge this one so we have master in a working state again. !246 (merged) can be put on top of this then once the patches are re-applied.
cc @alanc, @fujiwarat
Edited by Peter Hutterer