mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-19 19:20:58 +03:00
allow deny capture / emulation
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use ashpd::{desktop::ResponseError, Error::Response};
|
||||
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||
use reis::tokio::EiConvertEventStreamError;
|
||||
use std::io;
|
||||
@@ -75,6 +76,21 @@ pub enum EmulationCreationError {
|
||||
NoAvailableBackend,
|
||||
}
|
||||
|
||||
impl EmulationCreationError {
|
||||
/// request was intentionally denied by the user
|
||||
pub(crate) fn cancelled_by_user(&self) -> bool {
|
||||
match self {
|
||||
EmulationCreationError::Libei(LibeiEmulationCreationError::Ashpd(Response(
|
||||
ResponseError::Cancelled,
|
||||
)))
|
||||
| EmulationCreationError::Xdp(XdpEmulationCreationError::Ashpd(Response(
|
||||
ResponseError::Cancelled,
|
||||
))) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum WlrootsEmulationCreationError {
|
||||
|
||||
Reference in New Issue
Block a user