In Geany, we noticed with Scintilla 5 it's not possible to paste previously selected text with middle mouse button, i.e. using the primary clipboard.
Selecting text in the Scintilla widget and pasting it in another application works fine, also selecting text in another application and pasting it into the Scintilla widget using middle mouse button works fine.
Only selecting and pasting within the Scintilla widget does not work.
This used to work with Scintilla 3.x.
Tested and reproduced also with Scite (Version 5.1.4 Scintilla:5.1.3 Lexilla:5.1.2 compiled for GTK:3.24.30).
See [#2227] which made changes in this area. An issue here is that Wayland changed clipboard mechanisms so it should be recorded whether the issue is occurring on Wayland, X, or both.
Related
Bugs:
#2227Though I'm not sure what other effects this would have. I assume there
was a reason why the PRIMARY clipboard is emptied there.
Related
Bugs:
#2227Sorry for the missing information.
I'm using X11. I cannot test Wayland.
Seems like Sourceforge blocked my previous comment, so here again:
Sorry for the missing information.
I'm using X11. I cannot test Wayland.
The primary selection is emptied because the mouse click position is selected as the place to put the text. This can be avoided by delaying setting the new selection range until the primary selection text arrives. The attached patch does this by remembering the position of the mouse button press and applying this in the selection receive handler. It also has to apply it for an empty selection.
It is also possible to solve this by special-casing primary selection within the same instance but that may require more duplicated code.
The patch fixes the problem, pasting the primary clipboard within the
Scintilla works again. Thanks!
There is one detail which is different from other apps: pasting the
clipboard contents works only once. Pasting it directly again does not
work, probably for the same reason as you explained.
In other apps this is possible, you can paste the previously selected
contents multiple times as long as the selection is not changed.
Fix committed as [5f9bff].
Behaviour could be changed to not select location of paste but that would require a larger, more complex patch.
Related
Commit: [5f9bff]
Are there plans to fix this, or should I open a new issue? This is quite disruptive in my day-to-day usage.
Never mind; it seems to have been fixed in [fac2fb]. Thanks!
Related
Commit: [fac2fb]