fix(core): fix secure input watcher on non-macos systems
This commit is contained in:
parent
f266c3c23c
commit
17ffe488fe
|
@ -45,22 +45,34 @@ impl<'a> SecureInputSource<'a> {
|
||||||
|
|
||||||
impl<'a> funnel::Source<'a> for SecureInputSource<'a> {
|
impl<'a> funnel::Source<'a> for SecureInputSource<'a> {
|
||||||
fn register(&'a self, select: &mut Select<'a>) -> usize {
|
fn register(&'a self, select: &mut Select<'a>) -> usize {
|
||||||
select.recv(&self.receiver)
|
if cfg!(target_os = "macos") {
|
||||||
|
select.recv(&self.receiver)
|
||||||
|
} else {
|
||||||
|
999999
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn receive(&self, op: SelectedOperation) -> Event {
|
fn receive(&self, op: SelectedOperation) -> Event {
|
||||||
let si_event = op
|
if cfg!(target_os = "macos") {
|
||||||
.recv(&self.receiver)
|
let si_event = op
|
||||||
.expect("unable to select data from SecureInputSource receiver");
|
.recv(&self.receiver)
|
||||||
|
.expect("unable to select data from SecureInputSource receiver");
|
||||||
|
|
||||||
Event {
|
Event {
|
||||||
source_id: self.sequencer.next_id(),
|
source_id: self.sequencer.next_id(),
|
||||||
etype: match si_event {
|
etype: match si_event {
|
||||||
SecureInputEvent::Disabled => EventType::SecureInputDisabled,
|
SecureInputEvent::Disabled => EventType::SecureInputDisabled,
|
||||||
SecureInputEvent::Enabled { app_name, app_path } => {
|
SecureInputEvent::Enabled { app_name, app_path } => {
|
||||||
EventType::SecureInputEnabled(SecureInputEnabledEvent { app_name, app_path })
|
EventType::SecureInputEnabled(SecureInputEnabledEvent { app_name, app_path })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
println!("noop");
|
||||||
|
Event {
|
||||||
|
source_id: self.sequencer.next_id(),
|
||||||
|
etype: EventType::NOOP,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user