-
Notifications
You must be signed in to change notification settings - Fork 176
[GTK4] Implement Clipboard.getAvailableTypes() #1990
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
[GTK4] Implement Clipboard.getAvailableTypes() #1990
Conversation
Test Results 408 files - 137 408 suites - 137 19m 4s ⏱️ - 11m 57s Results for commit de14b38. ± Comparison against base commit 0fe4a76. This pull request removes 37 tests.
♻️ This comment has been updated with latest results. |
Doesn't this PR practically disable clipboard functionality almost entirely? |
Yes. But as mentioned, the clipboard is not implemented for GTK4. This method internally calls The last method uses GTK3-only methods which will always cause an UnsatisfiedLinkError. Lines 696 to 711 in 0f21a6e
|
I'm not sure if it is relevant but GDK4 seems to have a clipboard class. https://docs.gtk.org/gdk4/class.Clipboard.html and this seems to be the method to use for getting the formats: https://docs.gtk.org/gdk4/method.Clipboard.get_formats.html so can we sue this or is there a subtile difference between GTK and GDK that makes it impossible? |
In Gtk 3.x gdk used to be its own library but in Gtk 4.x gdk library has been merged into main libgtk. @ptziegler Would you look into that? If not give me few days and I'll try to look into it myself. |
The GDK clipboard is already used in some places but the implementation is not yet complete. Lines 44 to 51 in 0f21a6e
I can try to have a look what else is needed to complete this port, but I currently have to deal with allergy & stuff, so no promises... |
0a99081
to
7b1c4eb
Compare
I've updated the PR to instead implement the GTK4 case, rather than disabling it. Recording.webm |
7b1c4eb
to
a5c0906
Compare
As a side note: I've tested this together with #1984 and quite often the copy & paste actions in the popup menu don't work and the following error is logged.
This seems to be a GTK4 bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/4563 |
5327d80
to
8c637f5
Compare
8c637f5
to
cede0b5
Compare
bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java
Outdated
Show resolved
Hide resolved
The list of available types is calculated using the GDK4 clipboard and no longer falls back to the GTK3 bindings. Note that UTF8_STRING, COMPOUND_TEXT and STRING_ID are not implemented for GTK4, which is why those types must not be used in the TextTransfer, regardless of whether X11 or Wayland is used.
cede0b5
to
de14b38
Compare
For some reason the Linux GHA seems to switched to on run GTK4. As it's not due to this change and it actually fixes a crash I am ignoring it and merging. |
This is because the GTK4 label was added to this PR! Jenkins will still compile/run on GTK3. |
The list of available types is calculated using the GDK4 clipboard and
no longer falls back to the GTK3 bindings.
Note that UTF8_STRING, COMPOUND_TEXT and STRING_ID are not implemented
for GTK4, which is why those types must not be used in the TextTransfer,
regardless of whether X11 or Wayland is used.