Fwd: Re: Patch to XMonad.Actions.CycleRecentWS

Hello,
Please find a patch to XMonad.Actions.CycleRecentWS module of
xmonad-contrib.
Below is my conversation with the author of the package.
Thanks
Joe
----- Forwarded message from Michał Janeczek
Hello Michał,
Thanks for responding.
Also, what versions of xmonad and xmonad-contrib do you run? The latest darcs versions of xmonad and xmonad-contrib.
Also, could you send me your xmonad config? Please find attached.
Thanks for you email. From your XMonad config, are you using the `cycleRecentWS` function or `cycleWindowSets` with a custom `genOptions`?
If it's the standard `cycleRecentWS`, I'm confused how can it get that far without crashing, I'd think `head (workspaces w)` in `recentTags` helper function would crash first. Could you add, after importing Debug.Trace:
recentTags w = trace (show (workspaces w)) $ map tag $ tail (workspaces w) ++ [head (workspaces w)]
Below is the relevant portion of my xmonad config.
I get the list of workspaces. But, I filter them out in the below nonEmptyRecentsOnCurrentScreen to loop only those workspaces that are on the current screen. There could be hidden workspaces but they might belong to a different screen. Please let me know if that does not make sense.
-- I use mod-tab to start the action, and as soon as mod is -- released it ends the cycling that is, as long as I am -- holding down mod I can keep hitting tab to keep cycling -- back through less recent workspaces -- so you can hold down mod-shift (or whatever) and hit tab, -- tab, tab,... whoops I missed the workspace I wanted! ... -- type ` ... release. , ((m, xK_Tab), cycleWindowSets nonEmptyRecentsOnCurrentScreen [xK_space] xK_Tab xK_grave)
-- got this from -- http://m1.archiveorange.com/ -- m/att/j8BnA/ArchiveOrange_C872rLadnB1wa3dTcZztmNk4KA8a.hs
-- Build a list of windowsets with current swapped in turn with each -- "most recent" workspace as given by nonEmptyTags nonEmptyRecentsOnCurrentScreen :: S.StackSet String l a ScreenId sd -> [S.StackSet String l a ScreenId sd] nonEmptyRecentsOnCurrentScreen ws = -- map (S.view `flip` ws) -- (rotUp . Prelude.filter (\x -> isOnScreen x ws) -- $ nonEmptyTags ws) -- map (S.view `flip` ws) (rotUp $ nonEmptyTags ws) map (S.view `flip` ws) (rotUp . filterNonCurrentScreenWorkspaces $ nonEmptyTags ws) where currentScreen = S.screen . S.current $ ws filterNonCurrentScreenWorkspaces = Prelude.filter (\x -> fst (unmarshall x) == currentScreen) -- filterNonCurrentScreenWorkspaces = -- Prelude.filter (\x -> isOnScreen (S.view x ws) ws)
-- Given a windowset grab a list of the workspace tags, -- in the default order -- current, visibles in screen order, -- hiddens from most to least recently accessed. nonEmptyTags :: S.StackSet String l a s sd -> [String] nonEmptyTags ws = [ wtag | S.Workspace wtag _ (Just _) <- S.workspaces ws ]
, and send me the debug output? Please let me know if you still want me to send the debug output.
As my situation is different from normal, I guess you would not be interested in using the patch. I think it might be good to use the patch as it adds an error condition anyway. Just my 2 cents.
Thanks again for your prompt attention, Joe
----- End forwarded message -----
participants (1)
-
Joe M