Skip to content

zwlr_data_control_offer_v1¤

wayland.zwlr_data_control_offer_v1 ¤

Offer to transfer data

A wlr_data_control_offer represents a piece of data offered for transfer by another client (the source client). The offer describes the different MIME types that the data can be converted to and provides the mechanism for transferring the data directly from the source client.

Methods:

  • receive

    Request that the data is transferred

  • destroy

    Destroy this offer

  • on_offer

    Advertise offered mime type.

events

offer ¤

offer(mime_type: str) -> None

Advertise offered mime type

Sent immediately after creating the wlr_data_control_offer object. One event per offered MIME type.

Parameters:

  • mime_type ¤

    (str) –

    Offered mime type

receive ¤

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

Request that the data is transferred

To transfer the offered data, the client issues this request and indicates the MIME type 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 then closes its end, at which point the transfer is complete.

This request may happen multiple times for different MIME types.

Parameters:

  • mime_type ¤

    (str) –

    Mime type desired by receiver

  • fd ¤

    (fd) –

    File descriptor for data transfer

destroy ¤

destroy() -> None

Destroy this offer

Destroys the data offer object.

on_offer ¤

on_offer(mime_type: str) -> None

Advertise offered mime type.

Override to handle wayland.zwlr_data_control_offer_v1.events.offer.