summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Core.hs2
-rw-r--r--XMonad/Main.hsc7
2 files changed, 8 insertions, 1 deletions
diff --git a/XMonad/Core.hs b/XMonad/Core.hs
index cc3bf3e..b8ba1b1 100644
--- a/XMonad/Core.hs
+++ b/XMonad/Core.hs
@@ -86,6 +86,8 @@ data XConf = XConf
, mousePosition :: !(Maybe (Position, Position))
-- ^ position of the mouse according to
-- the event currently being processed
+ , currentEvent :: !(Maybe Event)
+ -- ^ event currently being processed
}
-- todo, better name
diff --git a/XMonad/Main.hsc b/XMonad/Main.hsc
index ed3fc59..33838c8 100644
--- a/XMonad/Main.hsc
+++ b/XMonad/Main.hsc
@@ -122,6 +122,11 @@ xmonad initxmc = do
, buttonActions = mouseBindings xmc xmc
, mouseFocused = False
, mousePosition = Nothing }
+ st = XState
+ { windowset = initialWinset
+ , mapped = S.empty
+ , waitingUnmap = M.empty
+ , dragging = Nothing }
st = XState
{ windowset = initialWinset
@@ -163,7 +168,7 @@ xmonad initxmc = do
prehandle e = let mouse = do guard (ev_event_type e `elem` evs)
return (fromIntegral (ev_x_root e)
,fromIntegral (ev_y_root e))
- in local (\c -> c { mousePosition = mouse }) (handleWithHook e)
+ in local (\c -> c { mousePosition = mouse, currentEvent = Just e }) (handleWithHook e)
evs = [ keyPress, keyRelease, enterNotify, leaveNotify
, buttonPress, buttonRelease]