after my app exits, other apps don't see this text. Clipboard empty. Why?
It is standard X11 behaviour, and is actually more efficient than Windows clipboard. Why, because on Windows, if you copy something to the clipboard you instantly get a copy, and thus it uses memory (RAM) to store that copy. On X11 when you copy something to the clipboard, it simply notifies the windowing system of the window that has content available, but no copy actually exists in RAM yet. Once once a target applications requests that content (via a Paste action), does it query the source window/application for the contents. This explains why you clipboard is empty, because that source application has already terminated.
Now some newer Window Managers in X11 support clipboard managers that can go against the X11 design. What these clipboard managers do, is become the "source" of the clipboard content, instead of the original source application. This clipboard managers keep running while the window manager runs, so you never get the "out of scope" situation.
If you want to see the technical details in how this is implemented, so applications (actually the GUI framework) can take advantage of such clipboard managers, take a look at how it was implemented in fpGUI Toolkit.
commit c2af2a386efef5d52db20482e81748fc36aedb91
Author: Andrew Haines <andrewd207@****>
Date: Wed Apr 24 17:24:50 2013 +0200
Persistent clipboard support under X11.
Some desktop environments or window managers include support for a clipboard
manager. This clipboard manager can make the content of the clipboard persistent
even after the source application closed down.