Ubuntu 22.04 Geany 1.38 everything up to date as of August 8th 2022
To reproduce: (initial state) clibpoard may have some content open geany create a new document open a terminal type "hello world" in geany select it in geany Crtl-C (supposeldy puts text "hello world" in clipboard) (optionally) left-click in geany to empty the selection set focus on terminal window by either crtl-tab or left-clicking the terminal window Shift-Insert (supposedly paste clipboard into terminal).
Expected behaviour: "hello world" appears in terminal Acutal behaviour: you will see whatever was in the clipboard at (initial state), and this is true also if (optionnally) was done
WFM Mint 21 (based on Ubuntu 22.04) more information needed or someone with Ubuntu 22.04 to try and reproduce.
I have started to diagnose using xclip. This gave me a reminder that there are two clipboards on Ubunutu : XA_PRIMARY and XA_CLIPBORAD
- Crtr-C in Geany copies to XA_CLIPBOARD (as expected) and not to XA_PRIMARY - Shift-Insert in terminal pastes the content of XA_PRIMARY, which is the cause of my problem
Fortunately, I discovered that Right-click -> popup menu -> Paste pastes XA_CLIPBOARD and not XA_PRIMARY, which I did not know
So the solution to my problem is: **to copy-paste from Geany to terminal, use the right click instead of shift-insert.**
Curiously this is not necessary for most other programs because (I just tested gedit and firefox): - selecting (silently and secretly) copies to XA_PRIMARY as soon as the selection is done (no need to de-select), a behaviour I did not know about btw - Crtl-C copies to XA_CLIPBOARD as expected (then XA_PRIMARY incidentally is equal to XA_CLIPBOARD until you select something else in one of those programs)
Btw I was used to do Ctrl-C in firefox then Shift-Insert in the terminal: the Ctrl-C step was in fact not necessary.
I do not know if this is voluntary or not that Geany does not behave like most other programs.
(My personnal opinion is that neither Geany nor Firefox are faltly: the user friendly way to go would be if Ubuntu developers could find a way to disable XA_PRIMARY, if it does not break the system; selecting would either copy to XA_CLIPBOARD or better: do nothing because personally I use selection as a bookmark to remember where I am while reading a specific page on Firefox; but this is not a concern for the Geany bug tracker ;-)
Er... In terminal, shift-insert pastes from xa_primary but crtl-insert copies to xa_clipboard. Is that normal?
X11 did not originally have the concept of a clipboard, it copied selections called "primary" and "secondary" and an application notified the server when it had a selection, and another application asked for the current selection when it was told to paste (traditionally by middle mouse click, but in terminal shift-insert does the same) and the server passed the request on to the application with the current selection. The selection was never "copied to a clipboard", either by user action or software. Thus large selections were copied between applications without another intermediate copy. But the selection had to remain in the application it was coming from, de-selecting as you did removed anything to copy and so your shift-insert did nothing.
As the windows ctrl-c and ctrl-v protocol became popular an additional "clipboard" was added so that content that was "copied" by ctrl-c could be advertised under a different name and the selection did not have to remain. Then an application where the user did ctrl-v (or ctrl-insert) could ask for the "clipboard" instead of the "primary" selection so that the original behaviour was also maintained.
So the behaviour you see is normal.
Closed #3244 as completed.
github-comments@lists.geany.org