Clipboard and selection in wayland.
Bill Spitzak
spitzak at gmail.com
Tue Mar 12 09:51:24 PDT 2013
On 03/11/2013 07:56 PM, Yichao Yu wrote:
> It may depends on how you define selecting but the point here is the
> content you start dragging should never clear the current PRIMARY
> selection (use x11 name to avoid ambiguity), e.g. if you drag the
> flower in the weston dnd demo, that shouldn't change what you are
> going to middle-button paste next.
That is interesting but I have not seen any real api's that do that. In
all cases they change the selection to the item being dragged (just
tried this on various file managers including Windows, and "drag" of an
icon always leaves it selected so that Ctrl+C copies it, and I believe
anything that changes what Ctrl+C will copy should also change what
middle-button-paste does. However I do think it is ok to be able to
distinguish these selections.
My primary concern is that applications be strongly encouraged to treat
middle-button-click and a "drop" the same, in that exactly the same data
is accepted and it works exactly the same in both cases. This is best
done by making the api shared so programs are encouraged to do the same
thing.
What I really am trying to say is that on a range of "similarity" the 3
apis should be something like this:
cut&paste .............................. middle-button-paste .. dnd
What should be avoided is the X mistake of making dnd be the "different"
one, which is why there are so many broken programs that confuse cut &
paste and middle-button-paste. Everything would be much better if all
those programs instead confused dnd and middle-button paste.
Mostly this means that the api for the target to retrieve the data for
dnd and for middle-button-paste should be IDENTICAL (except for an
integer saying "which"), and the source should be able to set the data
with identical api's, including the ability to say that the selection
and drag & drop are the same data and thus only set it once.
More information about the wayland-devel
mailing list