[xmonad] Change Layout Using a Hotkey

Brandon Allbery allbery.b at gmail.com
Fri May 3 16:05:00 CEST 2013


On Thu, May 2, 2013 at 8:04 PM, Brandon Allbery <allbery.b at gmail.com> wrote:

> Note the shortcomings, though:
>
> - if you want layout modifiers, they must be included here; there is no
> way to apply the layoutHook's layout modifiers to something not in the
> layoutHook.
> - layouts store state in their constructors in the layoutHook. This state
> will probably be inaccessible.
> - the layout and its state will be lost across mod-q because only the
> layoutHook is saved across invocations. No, it is not possible to save the
> keybindings on the off chance that someone hid a layout inside them.
> - layout modifiers with runtime behavior, as a result of the above, will
> either not have that behavior or will malfunction in various ways.
> (Example: mod-b to toggle struts would only toggle them in the layoutHook.
> - some runtime behavior is accomplished via sending messages to layouts.
> This, again, expects those layouts to be reachable via the manageHook, and
> often requires some state. At the very least, I expect broadcast messages
> will not reach your layout.
> - other things that know that the layout is reachable from layoutHook will
> break. I'm not thinking of any off the top of my head, but it's not
> unlikely that something in the xmonad core cares.
>

One more that just occurred to me: persistent ExtensibleState is stored
within the layout so it can be passed on via mod-q, and I'm not sure what
would happen to this state if you replace the layout with something not
reachable via layoutHook. (This may not only affect persistence across
restarts, but conceivably could result in anything using ExtensibleState
using an unrelated copy of that state post-setLayout. I would have to trace
through the ExtensibleState code to see if this is a problem, or if we hid
it in the Layout wrapper or something so it might get copied over
correctly.)

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20130503/929f71c1/attachment.htm>


More information about the xmonad mailing list