From 0e2c749b29597e12661c0bbd89f418fe963d9c77 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Tue, 30 Jul 2024 10:52:56 +0200 Subject: [PATCH] fix conditional compilation --- input-emulation/src/error.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/input-emulation/src/error.rs b/input-emulation/src/error.rs index bb54b90..c69f55a 100644 --- a/input-emulation/src/error.rs +++ b/input-emulation/src/error.rs @@ -87,19 +87,25 @@ pub enum EmulationCreationError { impl EmulationCreationError { /// request was intentionally denied by the user - #[cfg(all(unix, feature = "libei", not(target_os = "macos")))] pub(crate) fn cancelled_by_user(&self) -> bool { - matches!( + #[cfg(feature = "libei")] + if matches!( self, EmulationCreationError::Libei(LibeiEmulationCreationError::Ashpd(Response( ResponseError::Cancelled, - ))) | EmulationCreationError::Xdp(XdpEmulationCreationError::Ashpd(Response( + ))) + ) { + return true; + } + #[cfg(feature = "xdg_desktop_portal")] + if matches!( + self, + EmulationCreationError::Xdp(XdpEmulationCreationError::Ashpd(Response( ResponseError::Cancelled, ))) - ) - } - #[cfg(not(all(unix, feature = "libei", not(target_os = "macos"))))] - pub(crate) fn cancelled_by_user(&self) -> bool { + ) { + return true; + } false } }