[GTK4] Implement Clipboard supporting copy and pasting to other applications#2588
Conversation
Test Results 81 files - 27 81 suites - 27 8m 28s ⏱️ - 3m 0s Results for commit b4a8a24. ± Comparison against base commit 4a6ab2a. This pull request removes 8 tests.This pull request skips 3 tests.♻️ This comment has been updated with latest results. |
aac1268 to
28f4799
Compare
|
In addition the automated tests contained within this change the other ways to test this change involves manually running:
Testing has been done in GNOME (mutter wayland compositor), KDE (Kwin wayland compositor) and Xfce, both with clipboard managers disabled and enabled, with both Wayland and X11 as backend (X11 running in Xtigervnc for Xfce cases and Xwayland for wayland cases). Testing all completed on Ubuntu 25.10. |
28f4799 to
f0c7d03
Compare
|
Ready for review (but there are a bunch of parent PRs to merge first, so really only review the last commit in this PR). |
3ac5dc8 to
30bba21
Compare
Ready for reviewThis PR is ready for review, it needs running on a few more machines to give me some confidence that it works properly. Thank you @akurtakov @fedejeanne @Theo-Dann-Muirhead-Renesas for volunteering to run through this on your machine. I would appreciate if you can run the JUnit testing section below, if you want to try additional hands-on testing see the section lower down. JUnit testingTo test this, please do the following on a machine with GTK4 (e.g. Ubuntu 25.10 or Fedora 42 or one of their derivitives)
The setting you have configured on any clipboard manager may interfere with test results, especially if you have selection clipboard disabled or selection clipboard synchronized with main clipboard. Please report back pass/fail and what version you have used:
Additional manual testing(This is an expanded version of what I briefly mentioned in #2588 (comment)) Additional tests that can be done involve manually driving the clipboard, especially useful to make sure SWT on GTK4 is compatible with other apps on your machine: Setup
Now try and copy between each of these items for each type. For example:
Obviously the combinations of what can be copied/pasted is very big, but it would be useful to know if something that you expect should copy/paste does not work in GTK4. If something doesn't work, it may mean that we are missing some mime types or decoding contents of mime types incorrectly. ScreenshotsLaunch Configuration Example for Step 3a:
Wayland "Press me!" buttonOn Wayland some tests will be skipped if there is no user interaction with the test window. Press the "Press me!" button while tests are running to actually run those tests.
ClipboardExample
Test resultsRunning on my machineResults of running the tests on my machine: Ubuntu 25.10 and GTK4.20.1 Tested with following managers: Tested on the following windowing implementations:
Here are the results from one of those runs:
Running on GitHub actionsThe tests passed on GTK4.14.5 x11 Xvfb on GitHub actions here is build link (key line quoted): |
|
@jonahgraham I'll run the tests in my private laptop so outside office hours (probably this weekend) and report back :-) |
|
@jonahgraham I have run the tests and done some manual testing. I could not find a difference between how ClipboardExample running GTK4, and gtk4-demo Clipboard handled my actions. Operating System | Ubuntu 25.10
|
|
Run the automatic tests on:
All the tests succeeded just fine with both GDK_BACKENDs - x11 and wayland. Manually tested and works:
Overall, looks pretty solid. |
|
I have went through the code - it's quite a lot of work for sure! As the Gtk 3 code is clearly separated - Jonah, please merge when you feel it's ready to go and it can be further enhanced if needed later. |
30bba21 to
b4a8a24
Compare
…cations The pre-existing implementation of Clipboard for GTK4 only allowed copying and pasting within the application. Fixes eclipse-platform#2126
b4a8a24 to
52aa4f7
Compare
|
My last push changed the commit message to use full URL for #2126 instead of just Unfortunately there are a bunch of merged PRs of mine that have this same issue. |
Thanks @fedejeanne - I am going to merge now because I have a bunch of other PRs that are waiting on top of this one to proceed. If you have time to test this I would be grateful, especially if you are running something other than Ubuntu 25.10 (that @Theo-Dann-Muirhead-Renesas and I tested on) or Fedora 43 (that @akurtakov tested on) Once its merged it will also be easier to test because you won't need to rebuild natives 🥳 |
|
The failing windows run is unrelated (documented in #2670) The failing Linux run is because that is testing GTK4 so there are lots of unrelated test failures, I have confirmed that the clipboard tests pass:
Anyway, everything was checked before I force pushed again to fix commit message #2588 (comment) so I am going to merge this now. |
|
All automatic tests run green on my machine:
I also opened all the applications you mentioned for the manual testing and copied things back and forth and couldn't find any issues with it 👍 |
|
Thank you @fedejeanne @Theo-Dann-Muirhead-Renesas and @akurtakov for the extra testing.
I am very happy about this. It great to know that the implementation works on a relatively wide range of versions. |





The pre-existing implementation of Clipboard for GTK4 only allowed copying and pasting within the application.
Fixes #2126