-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add clipboard_has/get_image
methods to DisplayServer
#63826
Conversation
I think that's pretty useful to support. We'll indeed need a X11 implementation too (could be in a follow-up PR if someone else wants to work on it), and assess other platforms (Android, iOS, Web).
I agree, this should be done if this PR is accepted. That would also solve the awkwardness of There should also be support for |
I began to replace "clipboard" methods with "text" at the end. And I saw Shouldn't be easier to add this in |
Android provides the ability to copy/paste complex data structure, so this can be added as well as a follow-up PR once the initial one has landed. |
wen in the in the main? |
4.0 is in feature freeze, so this will have to wait for a future 4.x release to be merged. Also, this pull request needs to be rebased against the latest |
A rebase of godotengine#63826
Is there anything I could help with to get this merged? |
4.1 is currently in feature freeze, but you can test this PR locally and make sure it works as expected. We also recommend creating a publicly accessible testing project (cc @deakcor if they still have a copy of the project). That said, this PR needs to be rebased against the latest
Note that this particular part of the PR needs to be reverted, as we can't break compatibility anymore now that 4.0 is released. |
So I rebased and reverted the part with "_text" behind clipboard methods. If you validate the changes, let me know and I'll squash the commits into one |
Looks good to me overall. The classref needs to be updated, see the diff in https://github.com/godotengine/godot/actions/runs/5513089283/jobs/10050780703?pr=63826 CC @bruvzg to review Windows and macOS implementations. |
Strange, the checks succeeded before I squashed the commits but normally there isn't any issue. Let me know if I need to change anything. |
It's not related to PR and caused by #78749, I have restarted failed job. |
Co-Authored-By: RedworkDE <10944644+RedworkDE@users.noreply.github.com> Co-Authored-By: bruvzg <7645683+bruvzg@users.noreply.github.com>
clipboard_has/get_image
methods to DisplayServer
Thanks! This is great! Now we just need a volunteer to implement this for Linux :) |
Following proposal #2949, added
clipboard_get_image()
to get image from the clipboardclipboard_has_image()
to check if the clipboard has an image. It's faster thanclipboard_get_image()
so It may be useful to make a check (to disable a "paste" button for example)Override of
clipboard_has()
, may be faster for a huge text.They are only implemented on Windows and MacOS. Should be added on x11 (couldn't get a working result).
Here a code to try quickly (just add a texturerect in child) :
Also should be nice to rename
clipboard_has()
toclipboard_has_text()
andclipboard_get()
toclipboard_get_text()
. Or makeVariant
as result ofclipboard_get()
andclipboard_has()
should add an optional param to indicate what type it should check.Production edit: Closes godotengine/godot-proposals#2949.