Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Commit

Permalink
GetSelectionOwner request + reply
Browse files Browse the repository at this point in the history
  • Loading branch information
Antikyth committed Jan 23, 2023
1 parent 42ef809 commit 4897ae9
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/x11/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,4 +483,32 @@ derive_xrb! {
#[context(properties_len => usize::from(*properties_len))]
pub properties: Vec<Atom>,
}

/// 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<Window>,
[_; ..],
}
}
24 changes: 24 additions & 0 deletions src/x11/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit 4897ae9

Please sign in to comment.