Steps to reproduce: 1. Open document `foo.bar` in Geany. 2. Open the same document in e.g. `vi` and modify it. 3. Click inside the Scintilla widget inside Geany containing `foo.bar` 4. This single click selects several lines of code.
The selection below is a result of a single click: <img width="1005" alt="Screenshot 2024-06-13 at 16 02 18" src="https://github.com/geany/geany/assets/713965/89e45dd2-c49b-4ba8-945e-b62d5019f1c9">
What I think happens is that when the widget with the warning appears at the top of the window, Scintilla scrolls the text by the amount of the height of the widget and all this happens within the click handler. As the scroll happens while the click is in progress, selection is made between the start Scintilla position of the click and the end position after the scroll.
Maybe postponing the display with the warning to idle would help here.