Replying to both Mike and Geoff,
X11 does not actually provide any clipboard, it provides messages to allow clipboard contents to be transferred between apps when one asks for it. It is entirely up to apps what they offer as clipboard contents and for them to request something on user action. Also there are three messages called, "primary", "secondary" and confusingly "clipboard" so I'll quote it.
The tradition is for the selection to be offered as "primary" on selection, and to paste "primary" on middle mouse click, but its up to apps and they need never copy the clipboard contents except to return it when requested.
But since windows invented ctrl-XCV it has become traditional for apps to offer selection to "clipboard" on ctrl-XC and to request "clipboard" and paste it on ctrl-V but its up to the apps. Clearly when ctrl-X deletes the selection it needs to be saved by the app to continue to offer it, but thats internal to the app, not something X11 does.
"Secondary" has never really been standardised and isn't used much now.
Common X11 toolkits like GTK and Qt and Wx follow that convention and (bugs aside) also follow it on Wayland, so apps using them will tend to follow the convention, but apps that don't use toolkits may do their own thing, eg browsers.
Geany uses the GTK toolkit which handles paste in all widgets except the editing window, so having paste overwrite is GTKs decision. So having dialogs overwrite on middle click is up to GTK, but I'm not sure that having different parts of an application work different to convention is a good idea, so for _once_ I agree with something GTK decided :)
Cheers
Lex