Bugfix: make "refresh" actually behave as advertised (fixes #104)

This change fixes "refresh" by clearing the AssumedState of the
DisplayContext used to do the refresh operation.  Before this change,
"refresh" would trigger a redraw but the redraw would check the new
output picture against the previous one and determine that there were no
differences, resulting in a no-op redraw.  This change fixes that
behavior by first clearing the previous draw state of the DisplayContext
to force the output routine to conclude that the new picture is
different on every line.
This commit is contained in:
Jonathan Daugherty 2016-08-28 09:46:29 -07:00
parent 58f4e9bc12
commit 89e537b2a1

View File

@ -162,10 +162,13 @@ intMkVty input out = do
writeIORef lastUpdateRef $ Just updateData
writeIORef lastPicRef $ Just inPic'
let innerRefresh
= writeIORef lastUpdateRef Nothing
>> readIORef lastPicRef
>>= maybe ( return () ) ( \pic -> innerUpdate pic )
let innerRefresh = do
writeIORef lastUpdateRef Nothing
bounds <- displayBounds out
dc <- displayContext out bounds
writeIORef (assumedStateRef $ contextDevice dc) initialAssumedState
mPic <- readIORef lastPicRef
maybe (return ()) innerUpdate mPic
let gkey = do k <- atomically $ readTChan $ _eventChannel input
case k of