-
Notifications
You must be signed in to change notification settings - Fork 182
WIP - [GTK4] support Clipboard #2538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Test Results 88 files - 30 88 suites - 30 7m 44s ⏱️ - 2m 32s Results for commit b300e03. ± Comparison against base commit 810cbcc. This pull request removes 37 tests.
♻️ This comment has been updated with latest results. |
40292bc
to
bf0c317
Compare
bf0c317
to
7d94b02
Compare
I have split out some foundational work into the following PRs that can be reviewed now: |
7d94b02
to
0bbfb8c
Compare
A number of places in the GTK4 API there is the possibility of passing in arrays of Strings, i.e. Java String[] -> char ** as input argument to C side. This change adds better support to the JNI generator for this use case by converting the jobjectArray (String[]) to char ** on the C side. Part of #2126 Split out of #2538
0bbfb8c
to
b300e03
Compare
A number of places in the GTK4 API there is the possibility of passing in arrays of Strings, i.e. Java String[] -> char ** as input argument to C side. This change adds better support to the JNI generator for this use case by converting the jobjectArray (String[]) to char ** on the C side. Part of #2126 Split out of #2538
Testing the Clipboard can be difficult because there are a lot of system issues that can interfere, but of particular concern are: 1. System clipboard managers which may take ownership of the clipboard at unexpected times. 2. Limitations as to when processes can access clipboard, such as on Wayland where only active window can access clipboard. 3. Different behaviour when copying within a single process than between processes. These tests aim to resolve these issues. For the system clipboard manager there are a lot of extra sleep calls to allow clipboard manager to complete operations before continuing tests. In addition, we run all the tests multiple times by default to ensure stability. For the process limitations, we carefully control when the shell is created because we often cannot get focus back when shell ends up in the background. See the openAndFocusShell and openAndFocusRemote methods. For the different behaviours, we spin up a simple Swing app in a new process (the "remote" in openAndFocusRemote above). This app can be directed, over RMI, to access the clipboard. This allows our test to place data on the clipboard and ensure that the remote app can read the data successfully. For now this test only covers basic text (and a little of RTF). Adding Image and other transfers is part of the future work as such functionality is added in GTK4 while working on #2126 For the changes to SwtTestUtil that we required: 1. isGTK4 moved from Test_org_eclipse_swt_widgets_Shell.java to the Utils 2. processEvents was limited to 20 readAndDispatch calls per second due to the ordering of the targetTimestamp check. This change allows full speed readAndDispatching. 3. getPath was refactored to allow better control of source and destination of files extracted. See extracting of class files for remote Swing app in startRemoteClipboardCommands method Part of #2126 Split out of #2538
This was closed and will be replaced by a new PR - it was closed because I deleted my fork while trying to track down a git lfs issue I was having. |
This is my "its sort of working" Clipboard for GTK4.
This PR is a draft and contains a bunch of TODOs, some are questions for myself, some are questions for others. There are a number of items in here I plan to pull into separate PRs, so this PR may not be so interesting to review yet. But if someone want to, they should be able to run the new test class Test_org_eclipse_swt_dnd_Clipboard to see basic functionality working. This test seems reliable on my machine on GTK3, but not so much on GTK4 yet.
Once complete this will:
Fixes #2126