close window on close (duh)
This commit is contained in:
parent
0b8eac27f4
commit
54018ff71e
1 changed files with 9 additions and 0 deletions
|
@ -100,6 +100,7 @@ pre :: Affection StateData ()
|
||||||
pre = do
|
pre = do
|
||||||
sd <- getAffection
|
sd <- getAffection
|
||||||
_ <- partSubscribe (subKeyboard $ sdSubs sd) exitOnQ
|
_ <- partSubscribe (subKeyboard $ sdSubs sd) exitOnQ
|
||||||
|
_ <- partSubscribe (subWindow $ sdSubs sd) exitOnWindowClose
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
exitOnQ :: KeyboardMessage -> Affection StateData ()
|
exitOnQ :: KeyboardMessage -> Affection StateData ()
|
||||||
|
@ -110,6 +111,14 @@ exitOnQ (MsgKeyboardEvent _ _ _ _ sym) =
|
||||||
quit
|
quit
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
|
||||||
|
exitOnWindowClose :: WindowMessage -> Affection StateData ()
|
||||||
|
exitOnWindowClose wm =
|
||||||
|
case wm of
|
||||||
|
MsgWindowClose _ _ -> do
|
||||||
|
liftIO $ logIO Debug "I heard another one..."
|
||||||
|
quit
|
||||||
|
_ -> return ()
|
||||||
|
|
||||||
handle :: [SDL.EventPayload] -> Affection StateData ()
|
handle :: [SDL.EventPayload] -> Affection StateData ()
|
||||||
handle es = do
|
handle es = do
|
||||||
(Subsystems a b c) <- sdSubs <$> getAffection
|
(Subsystems a b c) <- sdSubs <$> getAffection
|
||||||
|
|
Loading…
Reference in a new issue