Bug 42618 - Copy & Paste is not functional
Summary: Copy & Paste is not functional
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other All
: medium major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-05 03:02 UTC by Cedric Sodhi
Modified: 2011-11-07 14:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Cedric Sodhi 2011-11-05 03:02:58 UTC
Although I don't see any chance that this bug will be fixed any time soon, given that it hasn't been rectified over the past ten years or so and is deeply seated in XLib and others, I'll just leave this here:

Xorg (and X11 for that matter) has no working (cross application) copy and paste mechanism. What is supposed to be such a mechanism is inconsistent, often unusuable and unpractical.

What a user of a windoing system expects is a global clipboard, such that things can be copied onto it from arbitrary sources and pasted from it to arbitrary destinations.

Furthermore, the user expects sensible shortcuts for these operations and nothing as ridiculous as middle-mouse-button (there are people who navigate X11 completely without mouse, mind you, not to mention those who don't have a middle mouse button or the option to press two mouse buttons syncronously, which is an equally ridicolous binding)

The user expects these shortcuts to be configurable, and, on a sidenote, is unlikely to desire it a combination which requires acrobatic skills, such as the current design choice seems to think it would be clever.

Ctrl-C and Ctrl-V , as they can be found on Microsoft Windows are a good example for practical, working shortcuts. Though of course for X11 something else would be desirable.

As for the actual mechanis itsself, it should not offer a single, unified interface to a LIFO based stack

copyToClipboard <content> [<overwrite>]
Copies <content> to the clipboard, overwriting the content on the clipboard marked with the hash <overwrite>, if <overwrite> is given. <content>, among other things is a structure describing the actual binary data and also metadata such as the mimetype, the application which pasted it, etc.

pasteFromClipboard [<hash> | <metafilter>]
Returns the content with <hash> from the clipboard or the content whose metadata matches <metafilter> which was pasted last. If neither is given, returns the content pasted last.

contentsOfClipboard [<metafilter>]
Returns the metadatas of the clipboard stack in the ordner in which the things have been pasted. If no <metafilter> is given, returns all pasted contents.

Useful metadata could include, among other things, the following fields:

Source: The application which pasted the content
Mimetype: The mimetype of the content
Persistent: Whether the data shall remain on the clipboard after the Source terminated
Time: Timestamp at which the data was pasted
etc...

This should be consistent across all applications. Whether, say, a terminal, automatically copies contents when they are selected, is a choise of the application. But it should not matter how and where they are copied, they should paste all the same.

Meaning if the user copies from the terminal, he will paste in firefox with the same key- or mouse combination that he pastes in another terminal.
Comment 1 Cedric Sodhi 2011-11-05 03:15:58 UTC
(contentsOfClipboard only returns metadata, the content of each entry itsself must be retrieved through pasteFromClipboard)
Comment 2 Jeremy Huddleston Sequoia 2011-11-07 14:48:36 UTC
This is out of scope for X11 itself.  X11 exposes the necessary functionality, 
and it is up to higher level toolkits to do the right thing.  File bugs against 
GTK, QT, XUL, etc if you feel things are inconsistent.


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.