Skip to content

Commit

Permalink
the present feature seems to require dri3
Browse files Browse the repository at this point in the history
enables running: 'cargo test --no-default-features --features present'
  • Loading branch information
alexanderkjall committed Nov 2, 2024
1 parent 2a0d3e6 commit 527ddd9
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions x11rb-protocol/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub mod dri3;
pub mod ge;
#[cfg(feature = "glx")]
pub mod glx;
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
pub mod present;
#[cfg(feature = "randr")]
pub mod randr;
Expand Down Expand Up @@ -464,7 +464,7 @@ fn get_request_name_internal(
_ => RequestInfo::UnknownRequest(Some("Glx"), minor_opcode),
}
}
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
present::X11_EXTENSION_NAME => {
match minor_opcode {
present::QUERY_VERSION_REQUEST => RequestInfo::KnownExt("Present::QueryVersion"),
Expand Down Expand Up @@ -1454,17 +1454,17 @@ pub enum Request<'input> {
GlxGetQueryObjectivARB(glx::GetQueryObjectivARBRequest),
#[cfg(feature = "glx")]
GlxGetQueryObjectuivARB(glx::GetQueryObjectuivARBRequest),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentQueryVersion(present::QueryVersionRequest),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentPixmap(present::PixmapRequest<'input>),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentNotifyMSC(present::NotifyMSCRequest),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentSelectInput(present::SelectInputRequest),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentQueryCapabilities(present::QueryCapabilitiesRequest),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentPixmapSynced(present::PixmapSyncedRequest<'input>),
#[cfg(feature = "randr")]
RandrQueryVersion(randr::QueryVersionRequest),
Expand Down Expand Up @@ -2579,7 +2579,7 @@ impl<'input> Request<'input> {
_ => (),
}
}
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Some((present::X11_EXTENSION_NAME, _)) => {
match header.minor_opcode {
present::QUERY_VERSION_REQUEST => return Ok(Request::PresentQueryVersion(present::QueryVersionRequest::try_parse_request(header, remaining)?)),
Expand Down Expand Up @@ -3544,17 +3544,17 @@ impl<'input> Request<'input> {
Request::GlxGetQueryObjectivARB(_) => Some(parse_reply::<glx::GetQueryObjectivARBRequest>),
#[cfg(feature = "glx")]
Request::GlxGetQueryObjectuivARB(_) => Some(parse_reply::<glx::GetQueryObjectuivARBRequest>),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentQueryVersion(_) => Some(parse_reply::<present::QueryVersionRequest>),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentPixmap(_) => None,
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentNotifyMSC(_) => None,
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentSelectInput(_) => None,
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentQueryCapabilities(_) => Some(parse_reply::<present::QueryCapabilitiesRequest>),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentPixmapSynced(_) => None,
#[cfg(feature = "randr")]
Request::RandrQueryVersion(_) => Some(parse_reply::<randr::QueryVersionRequest>),
Expand Down Expand Up @@ -4759,17 +4759,17 @@ impl<'input> Request<'input> {
Request::GlxGetQueryObjectivARB(req) => Request::GlxGetQueryObjectivARB(req),
#[cfg(feature = "glx")]
Request::GlxGetQueryObjectuivARB(req) => Request::GlxGetQueryObjectuivARB(req),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentQueryVersion(req) => Request::PresentQueryVersion(req),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentPixmap(req) => Request::PresentPixmap(req.into_owned()),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentNotifyMSC(req) => Request::PresentNotifyMSC(req),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentSelectInput(req) => Request::PresentSelectInput(req),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentQueryCapabilities(req) => Request::PresentQueryCapabilities(req),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Request::PresentPixmapSynced(req) => Request::PresentPixmapSynced(req.into_owned()),
#[cfg(feature = "randr")]
Request::RandrQueryVersion(req) => Request::RandrQueryVersion(req),
Expand Down Expand Up @@ -5770,9 +5770,9 @@ pub enum Reply {
GlxGetQueryObjectivARB(glx::GetQueryObjectivARBReply),
#[cfg(feature = "glx")]
GlxGetQueryObjectuivARB(glx::GetQueryObjectuivARBReply),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentQueryVersion(present::QueryVersionReply),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentQueryCapabilities(present::QueryCapabilitiesReply),
#[cfg(feature = "randr")]
RandrQueryVersion(randr::QueryVersionReply),
Expand Down Expand Up @@ -6923,13 +6923,13 @@ impl From<glx::GetQueryObjectuivARBReply> for Reply {
Reply::GlxGetQueryObjectuivARB(reply)
}
}
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
impl From<present::QueryVersionReply> for Reply {
fn from(reply: present::QueryVersionReply) -> Reply {
Reply::PresentQueryVersion(reply)
}
}
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
impl From<present::QueryCapabilitiesReply> for Reply {
fn from(reply: present::QueryCapabilitiesReply) -> Reply {
Reply::PresentQueryCapabilities(reply)
Expand Down Expand Up @@ -8414,15 +8414,15 @@ pub enum Event {
GlxBufferSwapComplete(glx::BufferSwapCompleteEvent),
#[cfg(feature = "glx")]
GlxPbufferClobber(glx::PbufferClobberEvent),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentCompleteNotify(present::CompleteNotifyEvent),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentConfigureNotify(present::ConfigureNotifyEvent),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentGeneric(present::GenericEvent),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentIdleNotify(present::IdleNotifyEvent),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
PresentRedirectNotify(present::RedirectNotifyEvent),
#[cfg(feature = "randr")]
RandrNotify(randr::NotifyEvent),
Expand Down Expand Up @@ -8648,7 +8648,7 @@ impl Event {
_ => Ok(Self::Unknown(event.to_vec())),
}
}
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Some((present::X11_EXTENSION_NAME, ext_info)) => {
match event_code - ext_info.first_event {
present::GENERIC_EVENT => Ok(Self::PresentGeneric(TryParse::try_parse(event)?.0)),
Expand Down Expand Up @@ -8781,7 +8781,7 @@ impl Event {
_ => Ok(Self::Unknown(event.to_vec())),
}
}
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Some(present::X11_EXTENSION_NAME) => {
match ge_event.event_type {
present::COMPLETE_NOTIFY_EVENT => Ok(Self::PresentCompleteNotify(TryParse::try_parse(event)?.0)),
Expand Down Expand Up @@ -8884,15 +8884,15 @@ impl Event {
Event::GlxBufferSwapComplete(value) => Some(value.sequence),
#[cfg(feature = "glx")]
Event::GlxPbufferClobber(value) => Some(value.sequence),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentCompleteNotify(value) => Some(value.sequence),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentConfigureNotify(value) => Some(value.sequence),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentGeneric(value) => Some(value.sequence),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentIdleNotify(value) => Some(value.sequence),
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentRedirectNotify(value) => Some(value.sequence),
#[cfg(feature = "randr")]
Event::RandrNotify(value) => Some(value.sequence),
Expand Down Expand Up @@ -9102,15 +9102,15 @@ impl Event {
Event::GlxBufferSwapComplete(value) => value.response_type,
#[cfg(feature = "glx")]
Event::GlxPbufferClobber(value) => value.response_type,
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentCompleteNotify(value) => value.response_type,
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentConfigureNotify(value) => value.response_type,
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentGeneric(value) => value.response_type,
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentIdleNotify(value) => value.response_type,
#[cfg(feature = "present")]
#[cfg(all(feature = "present", feature = "dri3"))]
Event::PresentRedirectNotify(value) => value.response_type,
#[cfg(feature = "randr")]
Event::RandrNotify(value) => value.response_type,
Expand Down

0 comments on commit 527ddd9

Please sign in to comment.