Dear ConTeXt Devs,

Here's a problem that I reported last year (https://mailman.ntg.nl/pipermail/ntg-context/2020/099862.html) with a wrong description. I thought that it had something to do with Firefox or browsers, but it turns out to be a much deeper and weirder problem messing up with the X window system.

Environment: Manjaro Linux 21.1.2, Xfce 4.16

Steps to reproduce:
1. `context --version`  # it can hardly be any more innocent
2.1. keep striking random keys in the terminal or mounsepad or whatever
2.2. or open a running-cat.gif in the background
Expected behavior: the characters should appear as you type, or the cat should keep running
Actual behavior: ~3s after `context --version` finishes, the terminal freezes and the character stops appearing for ~1s, or similarly, the cat stops running for ~1s

In short, ~3s upon termination of context, the X window stuck for ~1s.

More information:
1. The problem only appears 2 days after the fresh installation of latest context-lmtx, which was also the case last year.
2. `context --version` isn't doing anything, so it shouldn't be a resource problem, and I've got no such problem keeping 40+ pages open in chrome anyway.
3. Below is a more precise timing of the problem. The first output is the result of `context --version` along with the start and stop timestamps. The second output is a python one-liner printing timestamps each time it reads an <enter>. Notice how python reads an <enter> per ~0.05s until 00:33:21.597326, when it is blocked for ~0.7s.

I'm not sure if it's reproducible everywhere, and I'm willing to debug it myself, but I would need the source code of the context executable.

Thanks!

Best,
Sylvain

$ date +'%H:%M:%S.%N'; context --version; date +'%H:%M:%S.%N'
00:33:18.885305966
mtx-context     | ConTeXt Process Management 1.04
mtx-context     |
mtx-context     | main context file: /home/exprosic/apps/context-lmtx/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context     | current version: 2021.09.06 11:47
mtx-context     | main context file: /home/exprosic/apps/context-lmtx/tex/texmf-context/tex/context/base/mkxl/context.mkxl
mtx-context     | current version: 2021.09.06 11:47

00:33:18.969962042

$ python
>>> while input() or True: print(datetime.now())
...
2021-09-12 00:33:19.232685
2021-09-12 00:33:19.732828
2021-09-12 00:33:19.783645
2021-09-12 00:33:19.833808
(~0.05s per line, omitted 30 lines)
2021-09-12 00:33:21.394246
2021-09-12 00:33:21.445061
2021-09-12 00:33:21.496275
2021-09-12 00:33:21.546402
2021-09-12 00:33:21.597326 <--- ~0.05s per event until here
2021-09-12 00:33:21.646603 <--- stuck for 0.7s
2021-09-12 00:33:22.366133 <--- the stucked events flush in
2021-09-12 00:33:22.366269
2021-09-12 00:33:22.369491
2021-09-12 00:33:22.369765
2021-09-12 00:33:22.372800
2021-09-12 00:33:22.373038
2021-09-12 00:33:22.376233
2021-09-12 00:33:22.376444
2021-09-12 00:33:22.379487
2021-09-12 00:33:22.379687
2021-09-12 00:33:22.382737
2021-09-12 00:33:22.382960
2021-09-12 00:33:22.386020
2021-09-12 00:33:22.386253
2021-09-12 00:33:22.400795 <--- recovers ~0.05s per event
2021-09-12 00:33:22.451349
2021-09-12 00:33:22.503352
2021-09-12 00:33:22.553715
....