aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authorClemens Fruhwirth <clemens@endorphin.org>2010-10-16 18:47:57 +0200
committerClemens Fruhwirth <clemens@endorphin.org>2010-10-16 18:47:57 +0200
commitc082d7c0a1aa410375b7ff0167160785b528cdc5 (patch)
treee095e8d0ab5bb5a9684392c555c4afba36e5b43c /XMonad/Actions
parent96a228c312a19431eac4252b58c0cfafaaf91a84 (diff)
downloadXMonadContrib-c082d7c0a1aa410375b7ff0167160785b528cdc5.tar.gz
XMonadContrib-c082d7c0a1aa410375b7ff0167160785b528cdc5.tar.xz
XMonadContrib-c082d7c0a1aa410375b7ff0167160785b528cdc5.zip
Convert access of td_elementmap from field styled to function call styled in X.A.GridSelect
Ignore-this: b46942bf7ca0bd451b0b402ea8b01bf7 darcs-hash:20101016164757-ed0c4-15dcefcef583e40f4b8f0cb37518bc70a909dcb4.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r--XMonad/Actions/GridSelect.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/XMonad/Actions/GridSelect.hs b/XMonad/Actions/GridSelect.hs
index 0e8951a..45fe00f 100644
--- a/XMonad/Actions/GridSelect.hs
+++ b/XMonad/Actions/GridSelect.hs
@@ -266,8 +266,8 @@ drawWinBox win font (fg,bg) ch cw text x y cp =
updateAllElements :: TwoD a ()
updateAllElements =
do
- TwoDState { td_elementmap = els } <- get
- updateElements els
+ state <- get
+ updateElements (td_elementmap state)
updateElements :: TwoDElementMap a -> TwoD a ()
updateElements elementmap = do
@@ -308,8 +308,8 @@ handle :: (KeySym, t) -> Event -> TwoD a (Maybe a)
handle (ks,_) (KeyEvent {ev_event_type = t, ev_state = m })
| t == keyPress && ks == xK_Escape = return Nothing
| t == keyPress && ks == xK_Return = do
- (TwoDState { td_curpos = pos, td_elementmap = elmap }) <- get
- return $ fmap (snd . snd) $ findInElementMap pos elmap
+ state <- get
+ return $ fmap (snd . snd) $ findInElementMap (td_curpos state) (td_elementmap state)
| t == keyPress = do
m' <- liftX (cleanMask m)
keymap <- gets (gs_navigate . td_gsconfig)
@@ -327,11 +327,12 @@ handle (ks,_) (KeyEvent {ev_event_type = t, ev_state = m })
handle _ (ButtonEvent { ev_event_type = t, ev_x = x, ev_y = y })
| t == buttonRelease = do
- (TwoDState { td_elementmap = elmap, td_paneX = px, td_paneY = py,
- td_gsconfig = (GSConfig ch cw _ _ _ _ _ _) }) <- get
- let gridX = (fi x - (px - cw) `div` 2) `div` cw
+ state <- get
+ let (TwoDState { td_paneX = px, td_paneY = py,
+ td_gsconfig = (GSConfig ch cw _ _ _ _ _ _) }) = state
+ gridX = (fi x - (px - cw) `div` 2) `div` cw
gridY = (fi y - (py - ch) `div` 2) `div` ch
- case lookup (gridX,gridY) elmap of
+ case lookup (gridX,gridY) (td_elementmap state) of
Just (_,el) -> return (Just el)
Nothing -> eventLoop
| otherwise = eventLoop