Skip to content
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

clipboard.write cannot encode non-variant types #50

Open
Anaminus opened this issue May 31, 2021 · 0 comments
Open

clipboard.write cannot encode non-variant types #50

Anaminus opened this issue May 31, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Anaminus
Copy link
Owner

Certain formats specify EncodeTypes, allowing them to encode types that don't work with Variant (e.g. Objects, DescActions). Writing to the clipboard involves a number of format selectors, but only one value, which is pulled as a Variant. This causes the clipboard to fail on these non-variant types. In order to properly handle this, pulling the value must delayed so that each format selector can interpret the value in its own way.

Currently, the clipboard implementation is independent of the reflection layer (ClipboardSource) to provide a generic API usable by anything. An implementation that retains ClipboardSource would involve extracting the Lua stack to a []lua.LValue and passing it to ClipboardSource.Write.

The easier option would be to remove ClipboardSource entirely, and move the implementation back into the clipboard library functions. So far, I don't really see a use for having a reflection-independent implementation anyway. Notably, ClipboardSource isn't used anywhere else except the clipboard library. It also has a dependency on World, but only to get registered Formats and the world's Global for passing to Formats.

@Anaminus Anaminus added the bug Something isn't working label May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant