Hello.
Akaik, with X11 (GTK uses X11), the only way to keep clipboard after close is via a clipboard manager.
I dont know GTK but for fpGUI who keeps the clipboard after close, the atom CLIPBOARD_MANAGER is used:
atom_clipboard := XInternAtom(adisplay, pchar('CLIPBOARD_MANAGER'), False);
If atom_clipboard <> none then there is a clipboard manager installed.
In that case paste the clipboard of the application into the clipboard manager (2 lines of code).
So, lot of chance that GTK uses the same trick and if it does not work with Davo's code, it is maybe because the user does not have any clipboard manager installed.
Maybe.
Fre;D