Attention BBasile and others who were hit by this issue:
https://bugs.freepascal.org/view.php?id=21453I had to add define GTK_REMOVE_CLIPBOARD_NULL around the code that removes the NULL.
It will be in Lazarus 1.8RC2.
With a new version, add the define to Configure Build Lazarus dialog, check it and save settings. Next time you build Lazarus, the trailing NULL will be removed again.
Removing the trailing NULL here was apparently a wrong way as it created a regression bug, preventing copy/paste between Lazarus instances.
https://bugs.freepascal.org/view.php?id=31547That affected all GTK2 users but now it works again by default.
The trailing NULL bug appeared only in some machines, depending on window manager and desktop system I guess. For example I have not experienced it.
I still hope somebody studies the issue and fixes it properly.