% tmux -f /dev/null
% vim -u NONE +'set mouse=a' -o <(seq 1 499) <(seq 500 999)
then touch bottom window, then top window, do this a few times, notice that the content in top window scroll when touching bottom window! This problem does not occur in vim running outside tmux, or in vim in tmux through ssh from a computer using mouse click instead of touching.
Just tested with latest packages, the problem is still there.
My test steps are:
https://asciinema.org/a/elVSpsJsDtUhmx7hGre27lhvO?t=1:16 (This link valids for 7 days only)
(I want to switch between Vim splitted windows with touch, but this scrolling problem forces me to use Ctrl-ww instead.)
My apologies, just incorrectly tried to reproduce the issue :)
So doing touches like in your example really scrolls the top window.
I did experiments with micro editor and noticed that under tmux it may randomly start selecting text instead of moving cursor.
Under screen issue is unreproducible.
Using bluetooth mouse makes issue unreproducible under tmux.
Seems like something to do with how Termux handles touches.
Looks like I found what causes the issue, Termux sends 2 mouse events:
https://github.com/termux/termux-app/blob/master/terminal-view/src/main/java/com/termux/view/TerminalView.java#L93
commenting out the last one makes touches behave correctly, but I'm currently unaware of side effects introduced by such "patching". Maybe it was needed for "quick scale" gesture, but that one was disabled long time ago.
Moving the issue to termux-app repository...
@agguser Thanks for your detailed description! It might be related to an issue in tmux, could you try updating to version 2.9a-5 of the tmux package by running pkg up and see if it works better?
After pkg up, the problem has gone! Thanks.