summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Reedy <geoff@programmer-monk.net>2009-06-22 05:56:49 +0200
committerGeoff Reedy <geoff@programmer-monk.net>2009-06-22 05:56:49 +0200
commitdadaf8035b28b384d3055a21535569ba738cd493 (patch)
tree5f4ab36d9773bffe0b4c46bd9c58d3ed36f8cef0
parent84dbdbd36acde9a9b31b99976858895bc3255298 (diff)
downloadmetatile-dadaf8035b28b384d3055a21535569ba738cd493.tar
metatile-dadaf8035b28b384d3055a21535569ba738cd493.zip
track currently processing event
Ignore-this: da2e82037548ab176a4333056c94a07a darcs-hash:20090622035649-8d81a-de848ab7c732ae633b5c21333370d5aca43bf939
-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]