<AWT Dev> [PATCH] Use new clipboard APIs in Windows

Daniel Kamil Kozar dkk089 at gmail.com
Thu Jul 30 20:49:03 UTC 2020


Hello.
This is the patch which replaces usages of the old Windows APIs for
monitoring clipboard content with new ones introduced in Windows
Vista. The deficiencies of the old APIs are well known and might
result in some subscribed applications not receiving notifications
from the operating system, as they rely on all the applications in the
current clipboard chain processing clipboard messages properly.
Porting the code to use the new APIs not only makes OpenJDK immune to
these issues, but also results in slightly less code needed to support
clipboard-related functionality.
As this is a change that's very platform-specific, I don't think
providing a unit test is practical, as it would also require providing
a native application that runs alongside the test and deliberately
breaks the keyboard chain, resulting in OpenJDK not being able to
receive clipboard format change notifications. This is a
bug/limitation of the old Windows API, not OpenJDK itself. Anyhow, the
already existing ClipboardInterVMTest passes, which shows that already
existing functionality is not impacted by this change.

Kind regards,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: windows-clipboard-new-format-api.diff
Type: application/octet-stream
Size: 5935 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/awt-dev/attachments/20200730/ffa76beb/windows-clipboard-new-format-api.diff>


More information about the awt-dev mailing list