(0022171)
|
Zardoz
|
2022-03-28 19:25
|
|
It isn't fixed on 3.1 .
Tested on Ubuntu 21.10, using the DEB pagackage from DRDTeams repository.
Looks that it's a bug of SDL 1.2 on Linux :'https://www.bay12games.com/dwarves/mantisbt/view.php?id=7778 [^]'
> With the help of an X protocol tracer (http://www.chiark.greenend.org.uk/~sgtatham/xtruss/ [^]), the X Input Method protocol specification (http://www.x.org/releases/X11R7.7/doc/libX11/XIM/xim.html [^]), and several mugs of tea, I think I've found the cause.
When there's an X Input Method server (IMS) present, as there usually is on Ubuntu, Dwarf Fortress (DF) sends all its keyboard events to the IMS using the XIM protocol. In normal operation, when DF receives a KeyPress event from the X server, it passes it to the IMS in an XIM_FORWARD_EVENT message. The IMS (assuming it's not interested in this event) passes it back in another XIM_FORWARD_EVENT message, this time with the "synchronous" flag set. The "synchronous" flag tells DF that it now needs to send an XIM_SYNC_REPLY message, which it duly does.
When things go wrong, DF sends the XIM_FORWARD_EVENT message as usual, but fails to read the reply message and hence never sends the XIM_SYNC_REPLY message. Instead, it just carries on sending XIM_FORWARD_EVENT messages. It looks like the IMS refuses to deal with these, presumably because it's still waiting for XIM_SYNC_REPLY. This means that the keypresses never get forwarded back to DF, and it sits there unresponsive.
I've found that I can reproduce the bug simply by pressing F11 a few times in rapid succession (about five times in a second is usually enough).
I doubt that DF deliberately interfaces with input methods itself, so presumably this bug is somewhere in the depths of SDL or whatever library is implementing the XIM protocol.
For the record, on my Ubuntu 14.04 LTS system, the version of the SDL packages is "1.2.15-8ubuntu1.1".
With GZDoom looks that this not happens, as uses SDL 2 (and have better support of multiscreen setups as side effect).
As workaround, looks that killing the XIM related daemon should stop the problem (I couldn't totaly verified this, as tthis bug it's pretty random, and sometime only strikes when I'm playing a few hours. ) |
|