Today I tried to look at the clipboard bug myself, why isn't it working correctly. There is something strange in the CB code that I have found, in ScintillaWX.cpp, line 544-551 (rev 7076):
#ifdef __WXGTK__
for(int i=0; i<5; i++) {
//wxPrintf(wxT("Copying to clipboard %ld\n"), i);
CopyToClipboard(st);
}
#else
CopyToClipboard(st);
#endif
So basically, only if compiling for wxGTK, blindly repeat every copy operation to the clipboard 5 times. WTF?!
I guess some developer, whoever it was, must have met the same issue as I am experiencing right now (the reason for this thread), he also have noticed, that clipboard operations on wxGTK only work reliably if repeated some number of times. So he just built a loop around it. Unfortunately, it is still not working for me, I have to manually hit ctrl-c multiple times if I want a copy operation to succeed.
Now, I am NOT suggesting increasing the loop count. But rather, plz someone figure out what the real problem is. Why am I not doing it myself? Because I have no idea about GTK or wxWidgets (I never used their APIs before), and for someone who knows these libraries it would probably only take a neglible amount of time to check the CopyToClipboard(...) method. Anyway, that loop-5-times-or-else-it-does-not-work thing looks really crazy to me, not just because it is a questionable hack, but it obviously doesn't solve the problem.
Thank you.
using the blame function of SVN, then found it was change in:
killerbot 2008-8-16 2:15:17
* copy/cut-paste fixes in linux
* copy/move fixes on linux when drag and drop of selected text with the mouse
The wxWidgets changes I posted do definitely not fix the issue.
I attach a patch that hopefully is a better workaround than the hack we have in trunk at the moment.
I also build a test-version for debian/ubuntu and added it to my repo.
If you want to use apt (or dselect, synaptic or whatever) you need to add the following entries to /etc/apt/sources.list :
deb http://apt.jenslody.de/ any test
deb-src http://apt.jenslody.de/ any test
and remove entries for the normal nightlies, debugger branch or release.
Alternatively you can download the deb's directly from http://apt.jenslody.de/pool/test/c/codeblocks/ (http://apt.jenslody.de/pool/test/c/codeblocks/) .