This class is used to workaround the problem with getting clipboard contents (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4818143).
Although this bug is marked as fixed actually Sun just set 10 seconds timeout for
Clipboard.getContents(Object)
method which may cause unacceptably long UI freezes. So we worked around this as follows:
- for Macs we perform synchronization with system clipboard on a separate thread and schedule it when IDEA frame is activated
or Copy/Cut action in Swing component is invoked, and use native method calls to access system clipboard lock-free (?);
- for X Window we temporary set short timeout and check for available formats (which should be fast if a clipboard owner is alive).