[Lazarus] Clipboard Data Goes Away

Anthony Walter sysrpl at gmail.com
Thu Apr 1 09:26:47 CEST 2021

I noticed a recent discussion touching on this problem posted by Bo
Berglund on November 20, 2020 to this same mailing list.

Andreas Schneider replied in that thread, 'Pasting basically asks the
application that "copied" it to get the content. If that app is gone in the
meantime, there's nothing to paste anymore.'

Also, Colin Western replied this is how Linux applications work, 'the data
is kept with the source program, so goes when the program closes'.

I disagree.

I've tested several Gtk2 applications, including older versions of Gimp
and  Geany. Both these programs have clipboard copy functions and the data
on the clipboard from those applications my tests show their clipboard data
persists after they have been closed. So it would seem that Gtk2 the
clipboard works correctly and handles persisting data after an application
has exited.

I stepped through the LCL source and it looks like the clipboard code is
using some Gtk clipboard functions, and not using X windows functions,
thereby introducing a possible problem, but I am unsure if the LCL is using
the Gtk clipboard correctly. That is, the LCL might be using some Gtk
clipboard functions which seem to work well, but exhibit the problematic
behaviour I've described.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20210401/f3ccfabc/attachment.html>

More information about the lazarus mailing list