[Lazarus] Clipboard Data Goes Away

Anthony Walter sysrpl at gmail.com
Thu Apr 1 20:55:44 CEST 2021


Colin,

After some research I've found that LCL Gtk2 isn't using gtk_clipboard_x
functions, rather it's using gtk_selection_x functions. There are
gtk_clipboard functions to do the same thing as gtk_selection functions,
but because the gtk_clipboard functions are not being used, the
gtk_clipboard_store function does not work with the LCL Gtk2 clipboard.
I've written a mini clipboard class that allows for multiple formats on the
clipboard at the same time and it works well and also allows clipboard data
to persist after my application closes, but my design does not conform to
the WS (widgetset) model used by the LCL, and thus operates outside of the
LCL.

In the end, I'm confident that if LCL Gtk2 were written to use
gtk_clipboard functions instead of gtk_selection functions, the problem
could be fixed. I do not mean to place blame on any of the LCL Gtk2
developers, as the gtk_clipboard functions were most likely developed and
released sometime after the first few iterations of Gtk2. Particularly, the
gtk_clipboard_set_can_store did not exist until Gtk 2.6.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20210401/29c86f6b/attachment.html>


More information about the lazarus mailing list