3 ms·
> just make the clipboard visible when you copy, preferably on an OS level It's kind of impossible in general on an OS level†, since clipboards (a.k.a. your OS
by derefr 7y ago
> just make the clipboard visible when you copy, preferably on an OS level
It's kind of impossible in general on an OS level†, since clipboards (a.k.a. your OS's drag-and-drop system—clipboards just being asynchronous DnD-events) are a negotiated multi-format data transfer. Maybe everything you'd copy from a browser window is just HTML, but if you select e.g. an embedded Excel spreadsheet in a Word document and hit "copy", there's nothing comprehensible to the OS on the clipboard; and maybe nothing at all (until a particular drop-target responds to an accept-formats query.)
† Okay, it'd maybe be possible in AmigaOS, or any other similar OS (not that there are many) where all content encoding is inherently an OS job, not an application-layer job, such that the OS can see into every possible container format.
- chmod775 7y agoThe source would know how to render it and could provide the OS with some kind representation when asked (basically drawing the contents of the preview window).
- jameshart 7y agoThe suggestion to have the OS responsible for rendering is precisely to deal with the case of an untrusted source, Asking that source to tell you 'what did you really put on the clipboard?' is not going to get you a better answer.
- chmod775 7y ago> The suggestion to have the OS responsible for rendering is precisely to deal with the case of an untrusted source Your web browser is an untrusted source? You might be confusing the browser for the sites it displays. Browser vendors are unlikely to fight you trying to make copy & paste a better experience, they just lack ideas or a good solution that works across application/OS boundaries. In any case the OS wouldn't need the web browser to tell it how to display the text representation.
- tjoff 7y agoThe clipboard contains multiple formats. So if you paste a couple of excel cells in another sheet you get what you expect. But if you paste it into notepad you get a text representation. These do not need to contain the same thing, so the OS would need to preview all different formats and the user would have to manually inspect each of them.
- chmod775 7y ago> These do not need to contain the same thing, so the OS would need to preview all different formats and the user would have to manually inspect each of them. No. It just needs to preview the one that would be used by the destination. You could pretty much model this like existing drag & drop APIs, where whether a certain object is acceptable for "dropping" is communicated even before the user releases the mouse. In any case the OS doesn't need the application to tell it how to render the basic text representation.
- tjoff 7y agoYou don't know that until you paste, which might be a while after the copy and you also don't have the source available anymore in case it shows up weird, or you don't remember exactly what it was, or have it to compare to. This sounds quite cumbersome even for the techie. The basic text representation isn't enough. Maybe the text representation is correct but the html one embeds some javascript? How are you going to render that?