From bef717e6633395c173b5b17a76fae484794ab3b7 Mon Sep 17 00:00:00 2001 From: shy Date: Mon, 12 Apr 2021 21:45:45 +0200 Subject: [PATCH] Redraw after clock.toggle(). --- src/alarm.rs | 4 ++-- src/lib.rs | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) 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; } }