diff --git a/src/alarm.rs b/src/alarm.rs index fb049e0..cc6aa02 100644 --- a/src/alarm.rs +++ b/src/alarm.rs @@ -158,8 +158,8 @@ impl AlarmRoster { } // Check for active alarms. - pub fn active(&self) -> bool { - self.list.iter().any(|a| !a.exceeded) + pub fn idle(&self) -> bool { + !self.list.iter().any(|a| !a.exceeded) } // Check for exceeded alarms. diff --git a/src/lib.rs b/src/lib.rs index 106ee9e..bab5b6f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -77,7 +77,10 @@ pub fn run( layout.force_redraw = true; }, // (Un-)Pause clock on SIGUSR2. - SIGUSR2 => clock.toggle(), + SIGUSR2 => { + clock.toggle(); + layout.force_redraw = true; + }, // We didn't register anything else. _ => unreachable!(), } @@ -126,7 +129,7 @@ pub fn run( } } // Quit if configured. - if config.quit && !alarm_roster.active() { + if config.quit && alarm_roster.idle() { break; } }