Avoid unwanted selection when infobar shows by mouse click in Scintilla
commitabbe1c984f6da1f1a1fa89851b9d010e5d3a19ae
authorJiří Techet <techet@gmail.com>
Fri, 14 Jun 2024 11:17:41 +0000 (14 13:17 +0200)
committerJiří Techet <techet@gmail.com>
Fri, 14 Jun 2024 11:22:19 +0000 (14 13:22 +0200)
tree7586fbd2c22863e09f4f3a32dfd84051daf46bc3
parent05286579a253e2806192e863475b28b47843b2aa
Avoid unwanted selection when infobar shows by mouse click in Scintilla

Steps to reporduce:
1. Open file A in Geany
2. In a separate window, edit the same file (using e.g. vi)
3. Click to Geany editor so it regains focus
4. An infobar appears. As it appears, several lines in editor are selected

The selection is caused by the fact that as the same time the editor
is being clicked, Geany checks if the document was modified and shows
the info bar. The info bar makes the Scintilla editor smaller and it
scrolls by the amount of lines corresponding to the height of the
infobar. All this happens in the click handler and for Scintilla it
appears as if the mouse button was presses during the scroll and it makes
the selection.

Showing infobars on idle seems to fix the problem.

Fixes #3906.
src/document.c