mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-12-01 22:53:37 +03:00
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:
parent
58f4e9bc12
commit
89e537b2a1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user