From fefeae79de28446d46dc21e193aa34fcd4fe9002 Mon Sep 17 00:00:00 2001 From: Jochen Keil Date: Wed, 22 Aug 2012 20:52:52 +0200 Subject: Make it possible to delay Hide, Reveal and Toggle signals Previously Hide, Reveal and Toggle were immediate actions. This is the same behaviour as if called now with 0 as parameter. If the parameter is a positive non zero value it is taken as a delay for the requested action. After the delay (implemented using threadDelay) a new signal is sent with zero with no timeout being effective immediately. This is necessary to evaluate the persistency flag after the delay because it might have changed in the meantime. Effectively this means that it is possible to cancel the delayed operation by calling TogglePersistent. --- src/Signal.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Signal.hs') diff --git a/src/Signal.hs b/src/Signal.hs index 44fe4f9..8b3b325 100644 --- a/src/Signal.hs +++ b/src/Signal.hs @@ -36,9 +36,9 @@ instance Exception WakeUp data SignalType = Wakeup | Reposition | ChangeScreen - | Hide - | Reveal - | Toggle + | Hide Int + | Reveal Int + | Toggle Int | TogglePersistent deriving (Read, Show) -- cgit v1.2.3