fix(core): fix secure input watcher on non-macos systems

This commit is contained in:
Federico Terzi 2021-06-09 22:05:47 +02:00
parent f266c3c23c
commit 17ffe488fe

View File

@ -45,10 +45,15 @@ 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 {
if cfg!(target_os = "macos") {
select.recv(&self.receiver) select.recv(&self.receiver)
} else {
999999
}
} }
fn receive(&self, op: SelectedOperation) -> Event { fn receive(&self, op: SelectedOperation) -> Event {
if cfg!(target_os = "macos") {
let si_event = op let si_event = op
.recv(&self.receiver) .recv(&self.receiver)
.expect("unable to select data from SecureInputSource receiver"); .expect("unable to select data from SecureInputSource receiver");
@ -62,5 +67,12 @@ impl<'a> funnel::Source<'a> for SecureInputSource<'a> {
} }
}, },
} }
} else {
println!("noop");
Event {
source_id: self.sequencer.next_id(),
etype: EventType::NOOP,
}
}
} }
} }