patch: New XMonad.Layout.MessageControl module.

Hi, These patches provide a message escape/filtering facility intended to make it easier to control complex nested layouts via messages. The first one provides "unEscape" and "ignore" modifiers you could use to write something like this:
import XMonad.Layout.MessageControl
myLayout = Full ||| gimp ||| ... where gimp = ignore NextLayout $ ignore JumpToLayout $ unEscape $ mastered 0.01 0.2 (simpleTabbed ||| Grid)
nextOuterLayout = sendMessage NextLayout nextInnerLayout = sendMessage $ escape NextLayout
(see the XMonad.Layout.MessageControl patch for details. For clarification, "ignore" blocks all messages of the _same type_ as its parameter.) However, neither XMonad.Layout.(|||) nor XMonad.Layout.LayoutCombinators.(|||) can be used with this, because they both send messages (NextLayoutNoWrap) which have a private type and therefore cannot be filtered. Thus the patch to X.L.LayoutCombinators, which moves the NoWrap messages from their own type into the JumpLayout type, so that they can now be intercepted with "ignore JumpToLayout". I also made these constructors public because I don't like exporting data types with only part of their constructors, but that's not actually necessary and can be reverted if wanted. ... Also, when adding these modifiers into my Big Monstrous LayoutHook of Hell I had to add an {-# OPTIONS_GHC -fcontext-stack=40 #-} pragma to my xmonad.hs to prevent a context reduction overflow =).

Who's the LayoutCombinators czar? quentin.moser:
Hi,
These patches provide a message escape/filtering facility intended to make it easier to control complex nested layouts via messages.
The first one provides "unEscape" and "ignore" modifiers you could use to write something like this:
import XMonad.Layout.MessageControl
myLayout = Full ||| gimp ||| ... where gimp = ignore NextLayout $ ignore JumpToLayout $ unEscape $ mastered 0.01 0.2 (simpleTabbed ||| Grid)
nextOuterLayout = sendMessage NextLayout nextInnerLayout = sendMessage $ escape NextLayout
(see the XMonad.Layout.MessageControl patch for details. For clarification, "ignore" blocks all messages of the _same type_ as its parameter.)
However, neither XMonad.Layout.(|||) nor XMonad.Layout.LayoutCombinators.(|||) can be used with this, because they both send messages (NextLayoutNoWrap) which have a private type and therefore cannot be filtered.
Thus the patch to X.L.LayoutCombinators, which moves the NoWrap messages from their own type into the JumpLayout type, so that they can now be intercepted with "ignore JumpToLayout".
I also made these constructors public because I don't like exporting data types with only part of their constructors, but that's not actually necessary and can be reverted if wanted.
...
Also, when adding these modifiers into my Big Monstrous LayoutHook of Hell I had to add an {-# OPTIONS_GHC -fcontext-stack=40 #-} pragma to my xmonad.hs to prevent a context reduction overflow =).
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

* On Sunday, February 08 2009, Don Stewart wrote:
Who's the LayoutCombinators czar?
Nobody, though droundy was. Perhaps L.SubLayouts with the apropriate manageHook could replace LayoutCombinators, which may or may not be more sane about sending messages to the sublayouts.
quentin.moser:
Hi,
These patches provide a message escape/filtering facility intended to make it easier to control complex nested layouts via messages.
The first one provides "unEscape" and "ignore" modifiers you could use to write something like this:
import XMonad.Layout.MessageControl
myLayout = Full ||| gimp ||| ... where gimp = ignore NextLayout $ ignore JumpToLayout $ unEscape $ mastered 0.01 0.2 (simpleTabbed ||| Grid)
nextOuterLayout = sendMessage NextLayout nextInnerLayout = sendMessage $ escape NextLayout
(see the XMonad.Layout.MessageControl patch for details. For clarification, "ignore" blocks all messages of the _same type_ as its parameter.)
However, neither XMonad.Layout.(|||) nor XMonad.Layout.LayoutCombinators.(|||) can be used with this, because they both send messages (NextLayoutNoWrap) which have a private type and therefore cannot be filtered.
Thus the patch to X.L.LayoutCombinators, which moves the NoWrap messages from their own type into the JumpLayout type, so that they can now be intercepted with "ignore JumpToLayout".
I also made these constructors public because I don't like exporting data types with only part of their constructors, but that's not actually necessary and can be reverted if wanted.
...
Also, when adding these modifiers into my Big Monstrous LayoutHook of Hell I had to add an {-# OPTIONS_GHC -fcontext-stack=40 #-} pragma to my xmonad.hs to prevent a context reduction overflow =).
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
participants (3)
-
Adam Vogt
-
Don Stewart
-
Quentin Moser