The text areas in the messages panel are native controls. Therefore, the OS does everything, we don't even know.
The editor is not a native control, which makes things more complicated. What the "GPM hack" in Code::Blocks does is simply insert the current selection (if any) at the clicked location. It
does not modify the contents of the
clipboard, nor look at it. It's not perfect, but it offers at least some of the functionality.
One reason why we don't touch the clipboard is that the feature was meant to be present under Windows, too, which would be perceived as disturbing behaviour for Windows users. Also, to fully simulate GPM, more drastic things have to happen. Pasting into Code::Blocks is trivial, we can just read from the clipboard. However, the opposite direction is a lot more complicated. We cannot know that the user is going to middle-click another window the next instant, and when it happens, it's too late already. This means that we have to export the current selection to the clipboard every time the application loses focus, just in case. Gulp. No thank you
Surprisingly, some users reported shortly after this feature was implemented that they were now getting double-inserts. I didn't see how this could have been possible, but had to believe them (hey... why should they lie?). So, the feature was disabled under Linux. Anything you see under Linux is plainly the operating system's doing.
Funnily, from your description, Pecan's plugin seems to actually make it worse, as pasting into Code::Blocks from outside doesn't work any more while it would before... so you can see that
something is going on there from the operating system's side. I have no idea what messes up the copy from outside functionality, though.
The best thing may be to not touch anything, and let the OS do whatever it does :?