[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] Integrated: 8254825: Monitoring available clipboard formats should be done via new 
From:       Daniel Kamil Kozar <github.com+127875+xavery () openjdk ! java ! net>
Date:       2020-10-26 19:16:22
Message-ID: -rPQeOLOC_eQuSTsRQys8W44X14lb13AOusyb0qhesY=.0c6e23b9-c03b-4229-9fb2-ffbd60564e1d () github ! com
[Download RAW message or body]

On Sun, 11 Oct 2020 19:58:20 GMT, Daniel Kamil Kozar \
<github.com+127875+xavery@openjdk.org> wrote:

> This change replaces the usage of SetClipboardViewer with \
> Add/RemoveClipboardFormatListener, introduced in Windows Vista. This makes OpenJDK \
> immune to external applications failing to process clipboard messages properly. I \
> have put this proposal forward in the [mailing \
> list](https://mail.openjdk.java.net/pipermail/awt-dev/2020-July/015990.html), which \
> was tentatively accepted by Mr. Sergey Bylokhov. 
> 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. 
> I have prepared a proof-of-concept test which illustrates the deficiencies of the \
> old API, however it is not integrated with the test suite, as it requires compiling \
> a native WinAPI application. I will gladly share the source if needed.

This pull request has now been integrated.

Changeset: b4984336
Author:    Daniel Kamil Kozar <dkk089@gmail.com>
Committer: Sergey Bylokhov <serb@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/b4984336
Stats:     39 lines in 4 files changed: 0 ins; 28 del; 11 mod

8254825: Monitoring available clipboard formats should be done via new Windows APIs

Reviewed-by: serb

-------------

PR: https://git.openjdk.java.net/jdk/pull/594


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic