diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2026-01-01 21:56:35 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2026-01-01 21:56:35 -0700 |
| commit | 1df0b552f17f15942a350def6736d5535e545d4c (patch) | |
| tree | c10cf5d5da8a241147c62339d4aeaff04eb0352a /plug/src/Montis/Core | |
| parent | 4c5a5cc0eb92319719773e382fb43d5cb4098b13 (diff) | |
| download | montis-1df0b552f17f15942a350def6736d5535e545d4c.tar.gz montis-1df0b552f17f15942a350def6736d5535e545d4c.tar.bz2 montis-1df0b552f17f15942a350def6736d5535e545d4c.zip | |
[refactor] Run ormolu on all the source.
Diffstat (limited to 'plug/src/Montis/Core')
| -rw-r--r-- | plug/src/Montis/Core/ButtonEvent.hs | 18 | ||||
| -rw-r--r-- | plug/src/Montis/Core/Keys.hs | 19 | ||||
| -rw-r--r-- | plug/src/Montis/Core/W.hs | 6 |
3 files changed, 22 insertions, 21 deletions
diff --git a/plug/src/Montis/Core/ButtonEvent.hs b/plug/src/Montis/Core/ButtonEvent.hs index a8b336e..3a79922 100644 --- a/plug/src/Montis/Core/ButtonEvent.hs +++ b/plug/src/Montis/Core/ButtonEvent.hs @@ -1,16 +1,18 @@ {-# OPTIONS_GHC -Wno-missing-export-lists #-} + module Montis.Core.ButtonEvent where -import Montis.Foreign.WlRoots import Data.Word (Word32) import Foreign (Ptr) +import Montis.Foreign.WlRoots data ButtonState = ButtonReleased | ButtonPressed deriving (Show, Read, Eq, Enum, Ord) -data ButtonEvent = ButtonEvent { - pointer :: Ptr WlrPointer, - timeMs :: Word32, - button :: Word32, - modifiers :: Word32, - state :: ButtonState -} deriving (Eq, Show, Ord) +data ButtonEvent = ButtonEvent + { pointer :: Ptr WlrPointer, + timeMs :: Word32, + button :: Word32, + modifiers :: Word32, + state :: ButtonState + } + deriving (Eq, Show, Ord) diff --git a/plug/src/Montis/Core/Keys.hs b/plug/src/Montis/Core/Keys.hs index b3faadd..c9291e4 100644 --- a/plug/src/Montis/Core/Keys.hs +++ b/plug/src/Montis/Core/Keys.hs @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -Wno-missing-export-lists #-} + module Montis.Core.Keys where import Control.Monad (forever, void, when) @@ -9,9 +10,9 @@ import Control.Monad.Trans.Cont import Data.Bits import Data.Word import Montis.Core.ButtonEvent (ButtonEvent) +import qualified Montis.Core.ButtonEvent as ButtonEvent import Montis.Core.KeyEvent import qualified Montis.Core.KeyEvent as KeyEvent -import qualified Montis.Core.ButtonEvent as ButtonEvent import Montis.Core.W import Montis.Foreign.WlRoots (wlrSeatKeyboardNotifyKey, wlrSeatSetKeyboard) @@ -131,11 +132,11 @@ nextButtonOrKeyEvent :: KeysM (Either ButtonEvent KeyEvent) nextButtonOrKeyEvent = do st <- KeysM get KeysM $ - shiftT $ \rest -> - lift $ lift $ do - putButtonHandler (\ev -> evalStateT (rest (Left ev)) st) - handleContinuation st (\ev -> evalStateT (rest (Right ev)) st) - + shiftT $ \rest -> + lift $ + lift $ do + putButtonHandler (\ev -> evalStateT (rest (Left ev)) st) + handleContinuation st (\ev -> evalStateT (rest (Right ev)) st) where putButtonHandler h = do modify $ \st -> st {currentHooks = (currentHooks st) {buttonHook = h}} @@ -148,10 +149,8 @@ nextButtonOrKeyPress = do Left bev -> forwardButtonEvent bev >> nextButtonOrKeyPress Right kev | KeyEvent.state kev == KeyEvent.KeyPressed -> return ev Right kev -> forwardEvent kev >> nextButtonOrKeyPress - - where - forwardButtonEvent _ = return () - + where + forwardButtonEvent _ = return () -- | Returns the next KeyPressed event. This is likely what 90% of use cases -- want rather than nextKeyEvent. diff --git a/plug/src/Montis/Core/W.hs b/plug/src/Montis/Core/W.hs index b2046ff..9235b2f 100644 --- a/plug/src/Montis/Core/W.hs +++ b/plug/src/Montis/Core/W.hs @@ -19,9 +19,6 @@ import Data.Proxy import Data.Set (Set) import qualified Data.Set as Set import Foreign (Ptr, StablePtr, intPtrToPtr, ptrToIntPtr) -import Text.Printf (printf) -import Text.Read hiding (lift) -import Type.Reflection (someTypeRep, someTypeRepTyCon) import Montis.Core.ButtonEvent (ButtonEvent) import Montis.Core.KeyEvent import Montis.Core.SurfaceEvent @@ -30,6 +27,9 @@ import qualified Montis.Foreign.ForeignInterface as ForeignInterface import Montis.Foreign.WlRoots (Surface, WlrSeat) import Montis.StackSet hiding (layout) import qualified Montis.StackSet as StackSet +import Text.Printf (printf) +import Text.Read hiding (lift) +import Type.Reflection (someTypeRep, someTypeRepTyCon) data RationalRect = RationalRect Rational Rational Rational Rational |