Skip to content

zwlr_data_control_source_v1¤

wayland.zwlr_data_control_source_v1 ¤

Offer to transfer data

The wlr_data_control_source object is the source side of a wlr_data_control_offer. It is created by the source client in a data transfer and provides a way to describe the offered data and a way to respond to requests to transfer the data.

Methods:

error ¤

  • invalid_offer
    Offer sent after `wlr_data_control_device`.`set_selection`

events

send ¤

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

Send the data

Request for data from the client. Send the data as the specified MIME type over the passed file descriptor, then close it.

Parameters:

  • mime_type ¤

    (str) –

    Mime type for the data

  • fd ¤

    (fd) –

    File descriptor for the data

cancelled ¤

cancelled() -> None

Selection was cancelled

This data source is no longer valid. The data source has been replaced by another data source.

The client should clean up and destroy this data source.

offer ¤

offer(mime_type: str) -> None

Add an offered mime type

This request adds a MIME type to the set of MIME types advertised to targets. Can be called several times to offer multiple types.

Calling this after wlr_data_control_device.set_selection is a protocol error.

Parameters:

  • mime_type ¤

    (str) –

    Mime type offered by the data source

destroy ¤

destroy() -> None

Destroy this source

Destroys the data source object.

on_send ¤

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

Send the data.

Override to handle wayland.zwlr_data_control_source_v1.events.send.

on_cancelled ¤

on_cancelled() -> None

Selection was cancelled.

Override to handle wayland.zwlr_data_control_source_v1.events.cancelled.