vty 5.3.1 → 5.4.0
raw patch · 20 files changed
+88/−9 lines, 20 filesdep +stm
Dependencies added: stm
Files
- CHANGELOG +5/−0
- dist/build/verify-attribute-opsStub/verify-attribute-opsStub-tmp/verify-attribute-opsStub.hs +5/−0
- dist/build/verify-crop-span-generationStub/verify-crop-span-generationStub-tmp/verify-crop-span-generationStub.hs +5/−0
- dist/build/verify-display-attributesStub/verify-display-attributesStub-tmp/verify-display-attributesStub.hs +5/−0
- dist/build/verify-empty-image-propsStub/verify-empty-image-propsStub-tmp/verify-empty-image-propsStub.hs +5/−0
- dist/build/verify-eval-terminfo-capsStub/verify-eval-terminfo-capsStub-tmp/verify-eval-terminfo-capsStub.hs +5/−0
- dist/build/verify-image-opsStub/verify-image-opsStub-tmp/verify-image-opsStub.hs +5/−0
- dist/build/verify-image-transStub/verify-image-transStub-tmp/verify-image-transStub.hs +5/−0
- dist/build/verify-inlineStub/verify-inlineStub-tmp/verify-inlineStub.hs +5/−0
- dist/build/verify-layers-span-generationStub/verify-layers-span-generationStub-tmp/verify-layers-span-generationStub.hs +5/−0
- dist/build/verify-parse-terminfo-capsStub/verify-parse-terminfo-capsStub-tmp/verify-parse-terminfo-capsStub.hs +5/−0
- dist/build/verify-simple-span-generationStub/verify-simple-span-generationStub-tmp/verify-simple-span-generationStub.hs +5/−0
- dist/build/verify-terminalStub/verify-terminalStub-tmp/verify-terminalStub.hs +5/−0
- dist/build/verify-using-mock-terminalStub/verify-using-mock-terminalStub-tmp/verify-using-mock-terminalStub.hs +5/−0
- dist/build/verify-utf8-widthStub/verify-utf8-widthStub-tmp/verify-utf8-widthStub.hs +5/−0
- src/Graphics/Vty.hs +2/−2
- src/Graphics/Vty/Input.hs +2/−2
- src/Graphics/Vty/Input/Loop.hs +4/−3
- test/VerifyUsingMockInput.hs +2/−1
- vty.cabal +3/−1
CHANGELOG view
@@ -1,3 +1,8 @@+5.4.0+ - Changed eventChannel of Graphics.Vty.Input from Chan to TChan. This enables clients to query if+ there are no pending events. The Graphics.Vty interface nextEvent is unchanged. Clients that use+ eventChannel directly will require updating.+ https://github.com/coreyoconnor/vty/issues/60 5.3.1 - Reverted cabal file to depend on Cabal >= 1.18 instead of 1.20 due to possibly breaking this on reasonable GHC versions
+ dist/build/verify-attribute-opsStub/verify-attribute-opsStub-tmp/verify-attribute-opsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyAttributeOps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-crop-span-generationStub/verify-crop-span-generationStub-tmp/verify-crop-span-generationStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyCropSpanGeneration ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-display-attributesStub/verify-display-attributesStub-tmp/verify-display-attributesStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyDisplayAttributes ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-empty-image-propsStub/verify-empty-image-propsStub-tmp/verify-empty-image-propsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyEmptyImageProps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-eval-terminfo-capsStub/verify-eval-terminfo-capsStub-tmp/verify-eval-terminfo-capsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyEvalTerminfoCaps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-image-opsStub/verify-image-opsStub-tmp/verify-image-opsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyImageOps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-image-transStub/verify-image-transStub-tmp/verify-image-transStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyImageTrans ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-inlineStub/verify-inlineStub-tmp/verify-inlineStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyInline ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-layers-span-generationStub/verify-layers-span-generationStub-tmp/verify-layers-span-generationStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyLayersSpanGeneration ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-parse-terminfo-capsStub/verify-parse-terminfo-capsStub-tmp/verify-parse-terminfo-capsStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyParseTerminfoCaps ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-simple-span-generationStub/verify-simple-span-generationStub-tmp/verify-simple-span-generationStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifySimpleSpanGeneration ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-terminalStub/verify-terminalStub-tmp/verify-terminalStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyOutput ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-using-mock-terminalStub/verify-using-mock-terminalStub-tmp/verify-using-mock-terminalStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyUsingMockTerminal ( tests )+main :: IO ()+main = stubMain tests
+ dist/build/verify-utf8-widthStub/verify-utf8-widthStub-tmp/verify-utf8-widthStub.hs view
@@ -0,0 +1,5 @@+module Main ( main ) where+import Distribution.Simple.Test.LibV09 ( stubMain )+import VerifyUtf8Width ( tests )+main :: IO ()+main = stubMain tests
src/Graphics/Vty.hs view
@@ -59,7 +59,7 @@ import Graphics.Vty.Output import Graphics.Vty.Picture -import Control.Concurrent+import Control.Concurrent.STM import Data.IORef import Data.Monoid@@ -165,7 +165,7 @@ >> readIORef lastPicRef >>= maybe ( return () ) ( \pic -> innerUpdate pic ) - let gkey = do k <- readChan $ _eventChannel input+ let gkey = do k <- atomically $ readTChan $ _eventChannel input case k of (EvResize _ _) -> innerRefresh >> displayBounds out
src/Graphics/Vty/Input.hs view
@@ -136,7 +136,7 @@ import Graphics.Vty.Input.Loop import Graphics.Vty.Input.Terminfo -import Control.Concurrent+import Control.Concurrent.STM import Control.Lens import qualified System.Console.Terminfo as Terminfo@@ -193,7 +193,7 @@ let pokeIO = Catch $ do let e = error "vty internal failure: this value should not propagate to users" setAttrs- writeChan (input^.eventChannel) (EvResize e e)+ atomically $ writeTChan (input^.eventChannel) (EvResize e e) _ <- installHandler windowChange pokeIO Nothing _ <- installHandler continueProcess pokeIO Nothing return $ input
src/Graphics/Vty/Input/Loop.hs view
@@ -19,6 +19,7 @@ import Control.Applicative import Control.Concurrent+import Control.Concurrent.STM import Control.Exception (mask, try, SomeException) import Control.Lens import Control.Monad (when, mzero, forM_)@@ -43,7 +44,7 @@ data Input = Input { -- | Channel of events direct from input processing. Unlike 'nextEvent' this will not refresh -- the display if the next event is an 'EvResize'.- _eventChannel :: Chan Event+ _eventChannel :: TChan Event -- | Shuts down the input processing. This should return the terminal input state to before -- the input initialized. , shutdownInput :: IO ()@@ -96,7 +97,7 @@ emit :: Event -> InputM () emit event = do logMsg $ "parsed event: " ++ show event- view eventChannel >>= liftIO . flip writeChan event+ view eventChannel >>= liftIO . atomically . flip writeTChan event -- The timing requirements are assured by the VMIN and VTIME set for the device. --@@ -192,7 +193,7 @@ setFdOption fd NonBlockingRead False applyConfig fd config stopSync <- newEmptyMVar- input <- Input <$> newChan+ input <- Input <$> atomically newTChan <*> pure (return ()) <*> newIORef config <*> maybe (return Nothing)
test/VerifyUsingMockInput.hs view
@@ -14,6 +14,7 @@ import Control.Applicative import Control.Concurrent+import Control.Concurrent.STM import Control.Exception import Control.Lens ((^.)) import Control.Monad@@ -128,7 +129,7 @@ let readEvents = readLoop eventCount readLoop 0 = return () readLoop n = do- e <- readChan $ input^.eventChannel+ e <- atomically $ readTChan $ input^.eventChannel modifyIORef eventsRef ((:) e) readLoop (n - 1) genEventsUsingIoActions maxDuration writeWaitClose readEvents
vty.cabal view
@@ -1,5 +1,5 @@ name: vty-version: 5.3.1+version: 5.4.0 license: BSD3 license-file: LICENSE author: AUTHORS@@ -59,6 +59,7 @@ mtl >= 1.1.1.0 && < 2.3, parallel >= 2.2 && < 3.3, parsec >= 2 && < 4,+ stm, terminfo >= 0.3 && < 0.5, transformers >= 0.3.0.0, text >= 0.11.3,@@ -564,6 +565,7 @@ deepseq >= 1.1 && < 1.5, lens >= 3.9.0.2 && < 5.0, mtl >= 1.1.1.0 && < 2.3,+ stm, terminfo >= 0.3 && < 0.5, text >= 0.11.3, unix,