Skip to content

zwp_primary_selection_offer_v1¤

wayland.zwp_primary_selection_offer_v1 ¤

Offer to transfer primary selection contents

A wp_primary_selection_offer represents an offer to transfer the contents of the primary selection clipboard to the client. Similar to wl_data_offer, the offer also describes the mime types that the data can be converted to and provides the mechanisms for transferring the data directly to the client.

Methods:

  • receive

    Request that the data is transferred

  • destroy

    Destroy the primary selection offer

  • on_offer

    Advertise offered mime type.

events

offer ¤

offer(mime_type: str) -> None

Advertise offered mime type

Sent immediately after creating announcing the wp_primary_selection_offer through wp_primary_selection_device.data_offer. One event is sent per offered mime type.

receive ¤

receive(mime_type: str, fd: fd) -> None

Request that the data is transferred

To transfer the contents of the primary selection clipboard, the client issues this request and indicates the mime type that it wants to receive. The transfer happens through the passed file descriptor (typically created with the pipe system call). The source client writes the data in the mime type representation requested and then closes the file descriptor.

The receiving client reads from the read end of the pipe until EOF and closes its end, at which point the transfer is complete.

destroy ¤

destroy() -> None

Destroy the primary selection offer

Destroy the primary selection offer.

on_offer ¤

on_offer(mime_type: str) -> None

Advertise offered mime type.

Override to handle wayland.zwp_primary_selection_offer_v1.events.offer.