diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2009-03-03 07:57:01 +0100 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2009-03-03 07:57:01 +0100 |
commit | d559c448c070188c16f2958f78dc0f3c12d79441 (patch) | |
tree | e60934b82df143bff6a5f99789e4299ab2027810 /XMonad/Layout | |
parent | 139c282e1990722ce14b16007c180609ef2464ff (diff) | |
download | XMonadContrib-d559c448c070188c16f2958f78dc0f3c12d79441.tar.gz XMonadContrib-d559c448c070188c16f2958f78dc0f3c12d79441.tar.xz XMonadContrib-d559c448c070188c16f2958f78dc0f3c12d79441.zip |
Add Apply message to L.WindowNavigation
Ignore-this: e808729ddd2375778a96775568b8b621
darcs-hash:20090303065701-1499c-3c32f2d1c18dacdbac8ff07d7ba1a7ee3172da57.gz
Diffstat (limited to 'XMonad/Layout')
-rw-r--r-- | XMonad/Layout/WindowNavigation.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/XMonad/Layout/WindowNavigation.hs b/XMonad/Layout/WindowNavigation.hs index 949c60f..219aa37 100644 --- a/XMonad/Layout/WindowNavigation.hs +++ b/XMonad/Layout/WindowNavigation.hs @@ -68,7 +68,9 @@ import XMonad.Hooks.ManageDocks (Direction(..)) data MoveWindowToWindow a = MoveWindowToWindow a a deriving ( Read, Show, Typeable ) instance Typeable a => Message (MoveWindowToWindow a) -data Navigate = Go Direction | Swap Direction | Move Direction deriving ( Read, Show, Typeable ) +data Navigate = Go Direction | Swap Direction | Move Direction + | Apply (Window -> X()) Direction -- ^ Apply action with destination window + deriving ( Typeable ) instance Message Navigate data WNConfig = @@ -177,6 +179,10 @@ instance LayoutModifier WindowNavigation Window where ((w,_):_) -> do mst <- gets (W.stack . W.workspace . W.current . windowset) return $ do st <- mst Just $ Right $ SomeMessage $ MoveWindowToWindow (W.focus st) w + | Just (Apply f d) <- fromMessage m = + case navigable d pt wrs of + [] -> return Nothing + ((w,_):_) -> f w >> return Nothing | Just Hide <- fromMessage m = do XConf { normalBorder = nbc } <- ask mapM_ (sc nbc . fst) wrs |