Clipboard support beyond text/plain #1455
Replies: 3 comments
-
My proposal is closely based on how clipboard works on Wayland. I'd be curious to hear if macOS/Windows/Android are compatible with such a flow, or how they solve these issues. Should also be noted that both Wayland and Xorg have two clipboards. I don't thing any other platform does too. A trait |
Beta Was this translation helpful? Give feedback.
-
I see that Under the hood Both libraries also have a rather unusual model in that they expect all computation to be done before taking a selection. This results in [very little] unnecessary work when copying short texts, but would be quite substantial when copying images or videos or larger objects. My initial idea was to try and implement this outside of iced as some for of extension (at least as a PoC), but that doesn't seem to be possible since there's no way to access the underlying wayland connection. I'm considering addressing this feature, but I'm not sure where to start. There's three levels of abstraction here which would need to be re-implemented almost entirely since their API is orthogonal to clipboard itself. I'd appreciate hearing some thoughts/guidance here. |
Beta Was this translation helpful? Give feedback.
-
It might also make sense to wait and see if rust-windowing/winit#2156 gets a green light. |
Beta Was this translation helpful? Give feedback.
-
Looking at the API, it seems that clipboard support only works for
text/plain
and no other mime type (e.g.: no files, no images, etc). I guess it's fine for the simplest use case when only plain text is copying, but it's generally quite limited.It's also not possible to determine if the clipboard is taken or not (e.g.: a "paste" button should be disabled if there's nothing in the clipboard, but this cannot be determined right now).
I didn't find any issues discussing this, so figured I'd open one to open discussion on the topic. In general, and application will want to:
text/plain
, but anything else should be valid too.image/png
,image/jpeg
andtext/uri-list
. Encoding and serialisation will only happen when pasting, and only to the desired format.Beta Was this translation helpful? Give feedback.
All reactions