aboutsummaryrefslogtreecommitdiffstats
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
commitda9d918dc3ccf11f10c5fedb30f5fdc5c7be5022 (patch)
tree5f4ab36d9773bffe0b4c46bd9c58d3ed36f8cef0
parentb37808a2037888669e5e0f2422b2d078a874eb85 (diff)
downloadxmonad-da9d918dc3ccf11f10c5fedb30f5fdc5c7be5022.tar.gz
xmonad-da9d918dc3ccf11f10c5fedb30f5fdc5c7be5022.tar.xz
xmonad-da9d918dc3ccf11f10c5fedb30f5fdc5c7be5022.zip
track currently processing event
Ignore-this: da2e82037548ab176a4333056c94a07a darcs-hash:20090622035649-8d81a-de848ab7c732ae633b5c21333370d5aca43bf939.gz
-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]