It occurs even with mousequery disabled, so I think it's a bug in the search plugin (disabling the plugin gets rid of the bug, obviously, since there's no search option).
It occurs for me on OS X, both with r3 and r4. Evidently this isn't isolated to a single platform (although I'm unsure if it occurs on Windows or not). From the
code, I don't see any reason why mouse events should trigger anything, which leads me to believe it's a problem with DFHack's input handling. I haven't noticed it anywhere else, which is strange, but I'll see if there are other places where it occurs.
Edit: Some findings:
* It happens with 2D, PARTIAL, and STANDARD print modes (not sure about others)
* It occurs in multiple places besides the unit list, including announcements and the stocks screen (but _not_ in Falconne's (?) [e]nhanced view)
* It does
not occur with "modal" input boxes (e.g. Lua's gui.FramedScreen, tested with Putnam's hackWish script)
* It also doesn't occur with native DF input (e.g. filtering creatures in the arena, saving a macro)
Another edit: It looks like the search plugin uses a custom input field for searching, but I'm not sure if it's causing the problem or if it's caused by the input method it uses.