New patches: [XMonad.Actions.CycleRecentWS: support for different workspace switching behaviours; added cycleWindows Michal Janeczek **20080331210621] { hunk ./XMonad/Actions/CycleRecentWS.hs 22 + cycleWindows, hunk ./XMonad/Actions/CycleRecentWS.hs 26 +import Control.Monad hunk ./XMonad/Actions/CycleRecentWS.hs 34 +-- > import XMonad.Util.WindowProperties hunk ./XMonad/Actions/CycleRecentWS.hs 36 --- > , ((modMask x, xK_Tab), cycleRecentWS [xK_Alt_L] xK_Tab xK_grave) +-- > , ((modMask x, xK_Tab), +-- > cycleRecentWS W.view [xK_Alt_L] xK_Tab xK_grave) +-- > , ((modMask x .|. shiftMask, xK_Tab), +-- > cycleRecentWS W.greedyView [xK_Alt_L] xK_Tab xK_grave) +-- > +-- > -- cycle through Emacs windows with Alt-1 +-- > , ((modMask x, xK_1), +-- > cycleWindows (hasProperty (ClassName "Emacs")) +-- > W.focusWindow +-- > [xK_Alt_L] xK_1 xK_grave) +-- > , ((modMask x .|. shiftMask, xK_1), +-- > cycleWindows (hasProperty (ClassName "Emacs")) +-- > (\w -> W.swapMaster . W.focusWindow w) +-- > [xK_Alt_L] xK_1 xK_grave) hunk ./XMonad/Actions/CycleRecentWS.hs 60 -cycleRecentWS :: [KeySym] -- ^ A list of modifier keys used when invoking this action. - -- As soon as one of them is released, the final switch is made. - -> KeySym -- ^ Key used to switch to next (less recent) workspace. - -> KeySym -- ^ Key used to switch to previous (more recent) workspace. - -- If it's the same as the nextWorkspace key, it is effectively ignored. +cycleRecentWS :: (WorkspaceId -> WindowSet -> WindowSet) -- ^ A function used to focus on the workspace. + -> [KeySym] -- ^ A list of modifier keys used when invoking this action. + -- As soon as one of them is released, the final switch is made. + -> KeySym -- ^ Key used to switch to next (less recent) workspace. + -> KeySym -- ^ Key used to switch to previous (more recent) workspace. + -- If it's the same as the nextWorkspace key, it is effectively ignored. hunk ./XMonad/Actions/CycleRecentWS.hs 67 -cycleRecentWS = cycleWindowSets options - where options w = map (view `flip` w) (recentTags w) +cycleRecentWS switch = cycleWindowSets options + where options = do ws <- gets windowset + return $ map (flip switch ws) (recentTags ws) hunk ./XMonad/Actions/CycleRecentWS.hs 73 +-- | Cycle through windows matching a predicate using repeated presses of a key, +-- while a modifier key is held down. Windows on most recently visited workspaces +-- are tried first. For best effects use the same modkey+key combination as the one +-- used to invoke this action. +cycleWindows :: (Window -> X Bool) -- ^ A predicate used to filter matching windows + -> (Window -> WindowSet -> WindowSet) -- ^ A function used to focus on the window. + -> [KeySym] -- ^ A list of modifier keys used when invoking this action. + -- As soon as one of them is released, the final switch is made. + -> KeySym -- ^ Key used to switch to next matching window. + -> KeySym -- ^ Key used to switch to previous matching window. + -- If it's the same as the nextWindow key, it is effectively ignored. + -> X () +cycleWindows p switch = cycleWindowSets options + where options = do ws <- gets windowset + matching <- filterM p (recentWindows ws) + return $ map (flip switch ws) matching + -- Like allWindows, but tries to return more recently seen windows first. + -- The exception is currently focused window, which is put at the end of the list. + recentWindows ws = rotate (peek ws) $ concatMap (integrate'' . stack) (workspaces ws) + integrate'' (Just (Stack x l r)) = x : (l ++ r) + integrate'' Nothing = [] + rotate (Just _) (x:xs) = xs ++ [x] + rotate _ xxs = xxs + + hunk ./XMonad/Actions/CycleRecentWS.hs 104 -cycleWindowSets :: (WindowSet -> [WindowSet]) -- ^ A function used to create a list of WindowSets to choose from - -> [KeySym] -- ^ A list of modifier keys used when invoking this action. - -- As soon as one of them is released, the final WindowSet is chosen and the action exits. - -> KeySym -- ^ Key used to preview next WindowSet from the list of generated options - -> KeySym -- ^ Key used to preview previous WindowSet from the list of generated options. - -- If it's the same as nextOption key, it is effectively ignored. +cycleWindowSets :: X [WindowSet] -- ^ An action used to create a list of WindowSets to choose from + -> [KeySym] -- ^ A list of modifier keys used when invoking this action. + -- As soon as one of them is released, the final WindowSet is chosen and the action exits. + -> KeySym -- ^ Key used to preview next WindowSet from the list of generated options + -> KeySym -- ^ Key used to preview previous WindowSet from the list of generated options. + -- If it's the same as nextOption key, it is effectively ignored. hunk ./XMonad/Actions/CycleRecentWS.hs 112 - options <- gets $ genOptions . windowset + options <- genOptions } Context: [MultiToggle: add new XMonad.Layout.MultiToggle.Instances module for common instances of Transformer, update MultiToggle docs accordingly Brent Yorgey **20080331201739] [XMonad.Actions.CycleRecentWS: initial import Michal Janeczek **20080331111906] [XMonad.Hooks.ManageDocks: export checkDoc Lukas Mai **20080331012911] [XMonad.Layout.Grid: fix indentation Lukas Mai **20080330004859] [move Direction type from WindowNavigation to ManageDocks (ManageDocks will move into the core, taking Direction with it) Brent Yorgey **20080331010127] [ManageDocks: clean up + add more documentation Brent Yorgey **20080331002929] [Util.Run, Hooks.DynamicLog: re-export hPutStrLn and hPutStr from Util.Run for convenience, and update DynamicLog documentation to show proper imports Brent Yorgey **20080328205446] [ManageDocks: add avoidStrutsOn, for covering some docks and not others by default. Brent Yorgey **20080327203940] [ManageDocks: add ability to toggle individual gaps independently Brent Yorgey **20080327111722] [PerWorkspace: add modWorkspace(s) combinators, for selectively applying layout modifiers to certain workspaces but not others Brent Yorgey **20080326214351] [Haddock fix Roman Cheplyaka **20080330134435] [Remove stale status gaps code Spencer Janssen **20080329230737] [TAG 0.7 Spencer Janssen **20080329202416] Patch bundle hash: 85045fd47ca144fcbd339903f739f46414dda6de