From d559c448c070188c16f2958f78dc0f3c12d79441 Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Tue, 3 Mar 2009 07:57:01 +0100 Subject: Add Apply message to L.WindowNavigation Ignore-this: e808729ddd2375778a96775568b8b621 darcs-hash:20090303065701-1499c-3c32f2d1c18dacdbac8ff07d7ba1a7ee3172da57.gz --- XMonad/Layout/WindowNavigation.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'XMonad/Layout/WindowNavigation.hs') 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 -- cgit v1.2.3