some cleaning

This commit is contained in:
nek0 2017-02-20 20:22:01 +01:00
parent 2869e4b0d4
commit cb52296c8f
2 changed files with 3 additions and 5 deletions

View file

@ -16,7 +16,6 @@ import qualified SDL.Internal.Numbered as SDL (toNumber)
import qualified SDL.Raw as Raw import qualified SDL.Raw as Raw
import qualified GEGL as G import qualified GEGL as G
import qualified Data.Text as T
import Data.Maybe import Data.Maybe
import Data.IORef import Data.IORef
@ -134,16 +133,16 @@ getSurfaces window = do
preHandleEvents :: [SDL.Event] -> Affection us [SDL.Event] preHandleEvents :: [SDL.Event] -> Affection us [SDL.Event]
preHandleEvents evs = preHandleEvents evs =
catMaybes <$> mapM handle evs mapM handle evs
where where
handle e = handle e =
case SDL.eventPayload e of case SDL.eventPayload e of
SDL.WindowMovedEvent _ -> do SDL.WindowMovedEvent _ -> do
liftIO $ traceIO "I was moved" liftIO $ traceIO "I was moved"
putNewSurface putNewSurface
return Nothing return e
_ -> _ ->
return $ Just e return e
putNewSurface = do putNewSurface = do
ad <- get ad <- get
(oldSurf, surface) <- liftIO $ getSurfaces $ drawWindow ad (oldSurf, surface) <- liftIO $ getSurfaces $ drawWindow ad

View file

@ -85,7 +85,6 @@ data AffectionData us = AffectionData
, drawDimensions :: (Int, Int) -- ^ Dimensions of target surface , drawDimensions :: (Int, Int) -- ^ Dimensions of target surface
, drawStride :: Int -- ^ Stride of target buffer , drawStride :: Int -- ^ Stride of target buffer
, drawCPP :: Int -- ^ Number of components per pixel , drawCPP :: Int -- ^ Number of components per pixel
, clearStack :: [DrawRequest] -- ^ Stack of 'DrawRequest's to be invalidated
, elapsedTime :: Double -- ^ Elapsed time in seconds , elapsedTime :: Double -- ^ Elapsed time in seconds
} }