If you look in the various event copy functions in XExtInt.c, they as far as I can tell do not actually properly fill in the serial field, even though it exists in the cookie data.
http://patchwork.freedesktop.org/patch/13698/
commit 5d43d4914dcabb6de69859567061e99300e56ef4 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri May 17 09:07:44 2013 +1000 Copy the sequence number into the target event too (#64687)
Regression introduced by above commit, fixed with: commit 661c45ca17c434dbd342a46fd3fb813852ae0ca9 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Tue May 21 12:23:05 2013 +1000 Don't overwrite the cookies serial number
follow-up: http://patchwork.freedesktop.org/patch/62171/
Follow-up commit, see also https://bugzilla.gnome.org/show_bug.cgi?id=756649 commit 380861589690bcbe8b04b7a2c23b5dd5d10c4bf8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Oct 19 11:46:41 2015 +1000 Don't use raw serial numbers in XIEvents
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.