Clipboard and selection in wayland.

Yichao Yu yyc1992 at gmail.com
Mon Mar 11 10:59:52 PDT 2013


On Mon, Mar 11, 2013 at 1:19 PM, Bill Spitzak <spitzak at gmail.com> wrote:
> I think the solution is for "middle-button paste" to be done using the drag
> & drop mechanism, which is different than the selection.
>
> If the user selects an object and then clicks the middle mouse button, the
> result should be the same as if they instead dragged the selected object and
> then released at the position the middle mouse button was clicked.
>
> I'm not sure if the current drag & drop api can be made to do this. If not
> then it should be modified to do this, and some clients (such as the
> terminal at least) made to do this. It could even be default behavior for
> toolkits.

I think the middle button paste function is very different from
drag-and-drop. It's more like a auto-copy-clipboard. For
drag-and-drop, the client that starts the dnd (therefore provide the
data), should have focus but isn't(haven't been) necessarily selecting
anything. While for middle button paste (or normal clipboard), the
client that provide the data usually don't have the focus (unless it
is the same client that receives the data)

IMHO, the middle button paste should be supported by adding a set of
requests/events similar to those of selections to wl_data_device (just
like the relation between PRIMARY and CLIPBOARD selection in X11).
Since all toolkit support the middle button paste in x11 now, they
should support these just well in this way.

>
> Yichao Yu wrote:
>>
>> Hi,
>>
>> In X11 there are CLIPBOARD and PRIMARY selection each correspond to
>> the current clipboard and selected content and applications can
>> monitor the change of them using XFixes. In wayland, I have found
>> wl_data_device which I suppose should do the similar thing. The
>> question is, since there is only one wl_data_device::selection event,
>> is it possible to get current selected data as well as clipboard
>> content in wayland (or in another word is it possible to have X11's
>> handy middle button paste)? I also found the only weston client that
>> uses clipboard (weston-terminal) use it in a weird way, should this be
>> considered a bug and should the selection signal used in a similar way
>> as the XFixes signal in X to monitor clibpoard/selection changes?
>>
>>
>> Thanks.
>>
>> Yichao Yu
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list