pub enum Event {
    Target {
        mime_type: String,
    },
    Send {
        mime_type: String,
        fd: Handle,
    },
    Cancelled,
    DndDropPerformed,
    DndFinished,
    Action {
        dnd_action: DndAction,
    },
}

Variants§

§

Target

Fields

§mime_type: String

mime type accepted by the target

a target accepts an offered mime type

Sent when a target accepts pointer_focus or motion events. If a target does not accept any of the offered types, type is NULL.

Used for feedback during drag-and-drop.

§

Send

Fields

§mime_type: String

mime type for the data

§fd: Handle

file descriptor for the data

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.

§

Cancelled

selection was cancelled

This data source is no longer valid. There are several reasons why this could happen:

  • The data source has been replaced by another data source.
  • The drag-and-drop operation was performed, but the drop destination did not accept any of the mime types offered through wl_data_source.target.
  • The drag-and-drop operation was performed, but the drop destination did not select any of the actions present in the mask offered through wl_data_source.action.
  • The drag-and-drop operation was performed but didn’t happen over a surface.
  • The compositor cancelled the drag-and-drop operation (e.g. compositor dependent timeouts to avoid stale drag-and-drop transfers).

The client should clean up and destroy this data source.

For objects of version 2 or older, wl_data_source.cancelled will only be emitted if the data source was replaced by another data source.

§

DndDropPerformed

the drag-and-drop operation physically finished

The user performed the drop action. This event does not indicate acceptance, wl_data_source.cancelled may still be emitted afterwards if the drop destination does not accept any mime type.

However, this event might however not be received if the compositor cancelled the drag-and-drop operation before this event could happen.

Note that the data_source may still be used in the future and should not be destroyed here.

§

DndFinished

the drag-and-drop operation concluded

The drop destination finished interoperating with this data source, so the client is now free to destroy this data source and free all associated data.

If the action used to perform the operation was “move”, the source can now delete the transferred data.

§

Action

Fields

§dnd_action: DndAction

action selected by the compositor

notify the selected action

This event indicates the action selected by the compositor after matching the source/destination side actions. Only one action (or none) will be offered here.

This event can be emitted multiple times during the drag-and-drop operation, mainly in response to destination side changes through wl_data_offer.set_actions, and as the data device enters/leaves surfaces.

It is only possible to receive this event after wl_data_source.dnd_drop_performed if the drag-and-drop operation ended in an “ask” action, in which case the final wl_data_source.action event will happen immediately before wl_data_source.dnd_finished.

Compositors may also change the selected action on the fly, mainly in response to keyboard modifier changes during the drag-and-drop operation.

The most recent action received is always the valid one. The chosen action may change alongside negotiation (e.g. an “ask” action can turn into a “move” operation), so the effects of the final action must always be applied in wl_data_offer.dnd_finished.

Clients can trigger cursor surface changes from this point, so they reflect the current action.

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl IntoMessage for Event

§

type Error = EncodeError

source§

fn into_message(self, id: u32) -> Result<Message, <Self as IntoMessage>::Error>

Consumes |self| and serializes into a |Message|.
source§

impl MessageType for Event

source§

fn log(&self, this: ObjectId) -> String

Generates a string suitable for protocol logging this message.
source§

fn message_name(&self) -> &'static CStr

Returns a static CStr reference that describes the interface/method of this message. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V