diff --git a/src/x11/reply.rs b/src/x11/reply.rs index 1bf7e397..1b75eea9 100644 --- a/src/x11/reply.rs +++ b/src/x11/reply.rs @@ -483,4 +483,32 @@ derive_xrb! { #[context(properties_len => usize::from(*properties_len))] pub properties: Vec, } + + /// The [reply] to a [`GetSelectionOwner` request]. + /// + /// [reply]: crate::message::Reply + /// + /// [`GetSelectionOwner` request]: request::GetSelectionOwner + #[derive(Derivative, Debug, X11Size, Readable, Writable)] + #[derivative(Hash, PartialEq, Eq)] + pub struct GetSelectionOwner: Reply for request::GetSelectionOwner { + /// The sequence number identifying the [request] that generated this + /// [reply]. + /// + /// See [`Reply::sequence`] for more information. + /// + /// [request]: crate::message::Request + /// [reply]: crate::message::Reply + /// + /// [`Reply::sequence`]: crate::message::Reply::sequence + #[sequence] + #[derivative(Hash = "ignore", PartialEq = "ignore")] + pub sequence: u16, + + /// The owner of the given `selection`. + /// + /// If this is [`None`], then the selection has no owner. + pub owner: Option, + [_; ..], + } } diff --git a/src/x11/request.rs b/src/x11/request.rs index 5f382b5e..97725464 100644 --- a/src/x11/request.rs +++ b/src/x11/request.rs @@ -1551,4 +1551,28 @@ derive_xrb! { /// current time, this [request] has no effect. pub time: CurrentableTime, } + + /// A [request] that returns the owner of a given selection. + /// + /// # Errors + /// An [`Atom` error] is generated if `target` does not refer to a defined + /// [atom]. + /// + /// [atom]: Atom + /// + /// [`Atom` error]: error::Atom + #[derive(Debug, Hash, PartialEq, Eq, X11Size, Readable, Writable)] + pub struct GetSelectionOwner: Request(23) -> reply::GetSelectionOwner { + /// The selection for which this [request] returns its owner. + /// + /// # Errors + /// An [`Atom` error] is generated if this does not refer to a defined + /// [atom]. + /// + /// [atom]: Atom + /// [request]: crate::message::Request + /// + /// [`Atom` error]: error::Atom + pub target: Atom, + } }