Bug 52077 - implement modern clipboard
Summary: implement modern clipboard
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: wayland (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium enhancement
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-14 09:47 UTC by Carl
Modified: 2013-02-22 10:46 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Carl 2012-07-14 09:47:07 UTC
Please implement a modern clipboard while wayland is still being developed.  It's such a shame that linux itself has never had a proper one.  Instead work arounds such as clipboard managers, that only handle text, are implemented.  Here's how it works with xorg:

1.  You copy some text storing the location in memory where that text is
2.  You then tell another program to paste that text
3.  The program goes back to the xorg clipboard and asks for the text to be pasted
4.  The xorg clipboard asks the program that the text is supposed to come from for the text
5.  That program then says here is the text
6.  The text is then pasted into the new program

Now this process breaks if you close the original program before doing the pasting.  Windows and Mac users find this very frustrating!  Now the supposed fix is for each program to "check" if there is any data that the clipboard is pointing to.  Some have done it, but the vast majority have not because those developers are use to the way windows and mac do it, where it handles it for them and they don't have to worry about it.

Also that selection based clipboard thing has got to go.  It's only useful in the terminal because the terminal already was using the ctrl+c, ctrl+v, ctrl+x shortcut commands.  So instead of making it system wide, make it on a per application basis when those applications need it.  For example on windows, selection based copying works on mirc and putty, because they implemented it for only them to use it.  So if another program wants selection based copying, then that program can implement it.  Not many programs will I bet.

Now here is how we could redo it:

1.  When copying text, copy both the plain text version and the stylized version.  Any text pasting program can then specify if they want the stylized version, and if they don't, then they get the plain version.  But they still need to specify they want text as the type.
2.  Copying audio will identify that it is audio and programs that work with that, will expect that.  This way 2 audio programs can interact with each other.
3.  Copying video will identify that it is video and programs that work with that, will expect that.  This way 2 video programs can interact with each other.
4.  Copying files/directories will store the location of where the file/directory is and the name of it.  This will identify itself as a file/directory when doing pasting of it.  There will be 2 types though, one for a file, and one for a directory.  This way if the file manager needs to have a special way to handle a file and another way to handle a directory, it can do that.  Same thing if it's a symbolic link, both for soft and hard kinds being each of their own.
5.  For any other kinds of data, it will have a unique identifier that wayland has to support.  So if we need to add more types of data that the clipboard will support, we can do that.
6.  Finally we will be copying the data to the clipboard, not storing a pointer to it.  This solves the problem of what happens if you copy the data and then close the program before pasting it that frustrates so many windows and mac users who try out linux.
7.  One more thing, when a program quits and has data in the clipboard over a certain size, the program or wayland, will intercept when that program is told to quit, asking the user if they want to clear the clipboard or not since it would free up some memory.

Now this would be all nice if it was implemented.  And since wayland is still under development, I believe a proper implemented clipboard is the way to go.

And here's a rant on it:

http://elliotth.blogspot.com/2008/08/desktop-linux-suckage-clipboard.html
Comment 1 Kristian Høgsberg 2013-02-15 02:49:11 UTC
Closing this bug - we have a "modern clipboard" in the wayland protocol now.  If there's anything specific with the protocol or weston implementation that you think is broken, please file a bug on that issue, thanks.
Comment 2 Carl 2013-02-22 10:46:04 UTC
Can I get the link to the design document on how it is supposed to work?  Thank you.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.