fix: handle EINTR in evdev loop, silence SelectionRequest log spam
Some checks are pending
Build & Release / Build & test (push) Waiting to run
Build & Release / Build .deb (push) Blocked by required conditions

This commit is contained in:
Khoa Vo 2026-07-01 16:01:15 +07:00
parent db140c3ca6
commit 58ff9e145e
2 changed files with 11 additions and 5 deletions

View file

@ -1150,7 +1150,16 @@ fn run_with_evdev(
.get_key_state() .get_key_state()
.ok() .ok()
.unwrap_or_else(evdev::AttributeSet::new); .unwrap_or_else(evdev::AttributeSet::new);
let events = device.fetch_events()?; let events = match device.fetch_events() {
Ok(events) => events,
Err(e) => {
if e.kind() == std::io::ErrorKind::Interrupted {
// SIGINT/SIGTERM received — loop back to signal check
continue;
}
return Err(e.into());
}
};
last_event_time = std::time::Instant::now(); last_event_time = std::time::Instant::now();
// Check for status changes instantly // Check for status changes instantly

View file

@ -312,10 +312,7 @@ impl X11Injector {
} }
fn handle_selection_request(&self, req: &XSelectionRequestEvent) { fn handle_selection_request(&self, req: &XSelectionRequestEvent) {
eprintln!( // Silently handle — SelectionRequest floods the log on X11
"[vietc] SelectionRequest: target={} requestor={}",
req.target, req.requestor
);
// Determine what property to use for the response // Determine what property to use for the response
let property = if req.property == 0 { let property = if req.property == 0 {