This is an official upstream X.org patch which should fix the event handling bugs. http://cgit.freedesktop.org/xorg/xserver/commit/?id=1f4fb0225b278d1cf4145aebeb0bdd23dc8f62d5