When I click with the middle button (button 2), this quits qimgv and
triggers a ButtonRelease event in the underneath window, thus
affecting an unrelated application. A major consequence is that some
applications (such as xterm and rxvt) see this ButtonRelease event as
a click, and since this is a middle-click, if the window is accepting
input at this mouse position, this unexpectedly pastes data. For a
terminal like xterm or rxvt, this can be harmful, depending on what
is running and on what is pasted (this could be private data).
In no way an application should affect other applications like that.
The cause is that qimgv quits at the ButtonPress event instead of the
ButtonRelease event.