The middle button inserts the contents of the *PRIMARY* selection. The Paste action, however it is invoked, inserts the contents of the current *CUT* *BUFFER*. These are /not/ synchronised automatically, although you can synchronise them by hand.
Possibly OT, but speaking of copy&paste. I noticed that the cut buffer (or clipboard?) is cleared when geany exits, is there any reason for this?
I.e. I can select and copy text and paste it into e.g. gedit as long as I keep Geany open, but what I copied is lost if I close Geany in the meantime.
Best regards.