<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>XMonad.Layout.LayoutModifier</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_XMonad-Layout-LayoutModifier.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Layout-LayoutModifier.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">xmonad-contrib-0.9.2: Third party extensions for xmonad</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>unstable</td></tr><tr><th>Maintainer</th><td>none</td></tr></table><p class="caption">XMonad.Layout.LayoutModifier</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Usage </a></li><li><a href="#g:2">The <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> class </a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A module for writing easy layout modifiers, which do not define a layout in and of themselves, but modify the behavior of or add new functionality to other layouts. If you ever find yourself writing a layout which takes another layout as a parameter, chances are you should be writing a LayoutModifier instead! </p><p>In case it is not clear, this module is not intended to help you configure xmonad, it is to help you write other extension modules. So get hacking! </p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">class</span> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (m a), <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> (m a)) => <a href="#t:LayoutModifier">LayoutModifier</a> m a <span class="keyword">where</span><ul class="subs"><li><a href="#v:modifyLayout">modifyLayout</a> :: LayoutClass l a => m a -> Workspace WorkspaceId (l a) a -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a> -> X ([(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)], <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (l a))</li><li><a href="#v:handleMess">handleMess</a> :: m a -> SomeMessage -> X (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (m a))</li><li><a href="#v:handleMessOrMaybeModifyIt">handleMessOrMaybeModifyIt</a> :: m a -> SomeMessage -> X (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Either.html#t:Either">Either</a> (m a) SomeMessage))</li><li><a href="#v:pureMess">pureMess</a> :: m a -> SomeMessage -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (m a)</li><li><a href="#v:redoLayout">redoLayout</a> :: m a -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (Stack a) -> [(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)] -> X ([(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)], <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (m a))</li><li><a href="#v:pureModifier">pureModifier</a> :: m a -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (Stack a) -> [(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)] -> ([(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)], <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (m a))</li><li><a href="#v:hook">hook</a> :: m a -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li><a href="#v:unhook">unhook</a> :: m a -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li><a href="#v:modifierDescription">modifierDescription</a> :: m a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li><a href="#v:modifyDescription">modifyDescription</a> :: LayoutClass l a => m a -> l a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:ModifiedLayout">ModifiedLayout</a> m l a = <a href="#v:ModifiedLayout">ModifiedLayout</a> (m a) (l a)</li></ul></div><div id="interface"><h1 id="g:1">Usage </h1><div class="doc"><p>The <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> class is provided to help extension developers write easy layout modifiers. End users won't find much of interest here. =) </p><p>To write a layout modifier using the <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> class, define a data type to represent the layout modification (storing any necessary state), define an instance of <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code>, and export an appropriate function for applying the modifier. For example: </p><pre> data MyModifier a = MyModifier MyState deriving (Show, Read) instance LayoutModifier MyModifier a where -- override whatever methods from LayoutModifier you like modify :: l a -> ModifiedLayout MyModifier l a modify = ModifiedLayout (MyModifier initialState) </pre><p>When defining an instance of <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code>, you are free to override as many or as few of the methods as you see fit. See the documentation below for specific information about the effect of overriding each method. Every method has a default implementation; an instance of <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> which did not provide a non-default implementation of any of the methods would simply act as the identity on any layouts to which it is applied. </p><p>For more specific usage examples, see </p><ul><li> <a href="XMonad-Layout-WorkspaceDir.html">XMonad.Layout.WorkspaceDir</a> </li><li> <a href="XMonad-Layout-Magnifier.html">XMonad.Layout.Magnifier</a> </li><li> <a href="XMonad-Layout-NoBorders.html">XMonad.Layout.NoBorders</a> </li><li> <a href="XMonad-Layout-Reflect.html">XMonad.Layout.Reflect</a> </li><li> <a href="XMonad-Layout-Named.html">XMonad.Layout.Named</a> </li><li> <a href="XMonad-Layout-WindowNavigation.html">XMonad.Layout.WindowNavigation</a> </li></ul><p>and several others. You probably want to start by looking at some of the above examples; the documentation below is detailed but possibly confusing, and in many cases the creation of a <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> is actually quite simple. </p><p><em>Important note</em>: because of the way the <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> class is intended to be used, by overriding any of its methods and keeping default implementations for all the others, <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> methods should never be called explicitly. It is likely that such explicit calls will not have the intended effect. Rather, the <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> methods should only be called indirectly through the <code>LayoutClass</code> instance for <code><a href="XMonad-Layout-LayoutModifier.html#t:ModifiedLayout">ModifiedLayout</a></code>, since it is this instance that defines the semantics of overriding the various <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> methods. </p></div><h1 id="g:2">The <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> class </h1><div class="top"><p class="src"><span class="keyword">class</span> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (m a), <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> (m a)) => <a name="t:LayoutModifier" class="def">LayoutModifier</a> m a <span class="keyword">where</span><a href="src/XMonad-Layout-LayoutModifier.html#LayoutModifier" class="link">Source</a></p><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:modifyLayout" class="def">modifyLayout</a><a href="src/XMonad-Layout-LayoutModifier.html#modifyLayout" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: LayoutClass l a</td><td class="doc empty"> </td></tr><tr><td class="src">=> m a</td><td class="doc"><p>the layout modifier </p></td></tr><tr><td class="src">-> Workspace WorkspaceId (l a) a</td><td class="doc"><p>current workspace </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a></td><td class="doc"><p>screen rectangle </p></td></tr><tr><td class="src">-> X ([(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)], <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (l a))</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:modifyLayout">modifyLayout</a></code> allows you to intercept a call to <code>runLayout</code> <em>before</em> it is called on the underlying layout, in order to perform some effect in the X monad, and/or modify some of the parameters before passing them on to the <code>runLayout</code> method of the underlying layout. </p><p>The default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:modifyLayout">modifyLayout</a></code> simply calls <code>runLayout</code> on the underlying layout. </p></div><p class="src"><a name="v:handleMess" class="def">handleMess</a> :: m a -> SomeMessage -> X (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (m a))<a href="src/XMonad-Layout-LayoutModifier.html#handleMess" class="link">Source</a></p><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:handleMess">handleMess</a></code> allows you to spy on messages to the underlying layout, in order to have an effect in the X monad, or alter the layout modifier state in some way (by returning <code>Just nm</code>, where <code>nm</code> is a new modifier). In all cases, the underlying layout will also receive the message as usual, after the message has been processed by <code><a href="XMonad-Layout-LayoutModifier.html#v:handleMess">handleMess</a></code>. </p><p>If you wish to possibly modify a message before it reaches the underlying layout, you should use <code><a href="XMonad-Layout-LayoutModifier.html#v:handleMessOrMaybeModifyIt">handleMessOrMaybeModifyIt</a></code> instead. If you do not need to modify messages or have access to the X monad, you should use <code><a href="XMonad-Layout-LayoutModifier.html#v:pureMess">pureMess</a></code> instead. </p><p>The default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:handleMess">handleMess</a></code> calls <code><a href="XMonad-Layout-LayoutModifier.html#v:unhook">unhook</a></code> when receiving a <code>Hide</code> or <code>ReleaseResources</code> method (after which it returns <code>Nothing</code>), and otherwise passes the message on to <code><a href="XMonad-Layout-LayoutModifier.html#v:pureMess">pureMess</a></code>. </p></div><p class="src"><a name="v:handleMessOrMaybeModifyIt" class="def">handleMessOrMaybeModifyIt</a> :: m a -> SomeMessage -> X (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Either.html#t:Either">Either</a> (m a) SomeMessage))<a href="src/XMonad-Layout-LayoutModifier.html#handleMessOrMaybeModifyIt" class="link">Source</a></p><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:handleMessOrMaybeModifyIt">handleMessOrMaybeModifyIt</a></code> allows you to intercept messages sent to the underlying layout, in order to have an effect in the X monad, alter the layout modifier state, or produce a modified message to be passed on to the underlying layout. </p><p>The default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:handleMessOrMaybeModifyIt">handleMessOrMaybeModifyIt</a></code> simply passes on the message to <code><a href="XMonad-Layout-LayoutModifier.html#v:handleMess">handleMess</a></code>. </p></div><p class="src"><a name="v:pureMess" class="def">pureMess</a> :: m a -> SomeMessage -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (m a)<a href="src/XMonad-Layout-LayoutModifier.html#pureMess" class="link">Source</a></p><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:pureMess">pureMess</a></code> allows you to spy on messages sent to the underlying layout, in order to possibly change the layout modifier state. </p><p>The default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:pureMess">pureMess</a></code> ignores messages sent to it, and returns <code>Nothing</code> (causing the layout modifier to remain unchanged). </p></div><p class="src"><a name="v:redoLayout" class="def">redoLayout</a><a href="src/XMonad-Layout-LayoutModifier.html#redoLayout" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: m a</td><td class="doc"><p>the layout modifier </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a></td><td class="doc"><p>screen rectangle </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (Stack a)</td><td class="doc"><p>current window stack </p></td></tr><tr><td class="src">-> [(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)]</td><td class="doc"><p>(window,rectangle) pairs returned by the underlying layout </p></td></tr><tr><td class="src">-> X ([(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)], <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (m a))</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:redoLayout">redoLayout</a></code> allows you to intercept a call to <code>runLayout</code> on workspaces with at least one window, <em>after</em> it is called on the underlying layout, in order to perform some effect in the X monad, possibly return a new layout modifier, and/or modify the results of <code>runLayout</code> before returning them. </p><p>If you don't need access to the X monad, use <code><a href="XMonad-Layout-LayoutModifier.html#v:pureModifier">pureModifier</a></code> instead. Also, if the behavior you need can be cleanly separated into an effect in the X monad, followed by a pure transformation of the results of <code>runLayout</code>, you should consider implementing <code><a href="XMonad-Layout-LayoutModifier.html#v:hook">hook</a></code> and <code><a href="XMonad-Layout-LayoutModifier.html#v:pureModifier">pureModifier</a></code> instead of <code><a href="XMonad-Layout-LayoutModifier.html#v:redoLayout">redoLayout</a></code>. </p><p>On empty workspaces, the Stack is Nothing. </p><p>The default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:redoLayout">redoLayout</a></code> calls <code><a href="XMonad-Layout-LayoutModifier.html#v:hook">hook</a></code> and then <code><a href="XMonad-Layout-LayoutModifier.html#v:pureModifier">pureModifier</a></code>. </p></div><p class="src"><a name="v:pureModifier" class="def">pureModifier</a><a href="src/XMonad-Layout-LayoutModifier.html#pureModifier" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: m a</td><td class="doc"><p>the layout modifier </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a></td><td class="doc"><p>screen rectangle </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (Stack a)</td><td class="doc"><p>current window stack </p></td></tr><tr><td class="src">-> [(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)]</td><td class="doc"><p>(window, rectangle) pairs returned by the underlying layout </p></td></tr><tr><td class="src">-> ([(a, <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a>)], <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (m a))</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:pureModifier">pureModifier</a></code> allows you to intercept a call to <code>runLayout</code> <em>after</em> it is called on the underlying layout, in order to modify the list of window/rectangle pairings it has returned, and/or return a new layout modifier. </p><p>The default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:pureModifier">pureModifier</a></code> returns the window rectangles unmodified. </p></div><p class="src"><a name="v:hook" class="def">hook</a> :: m a -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/XMonad-Layout-LayoutModifier.html#hook" class="link">Source</a></p><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:hook">hook</a></code> is called by the default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:redoLayout">redoLayout</a></code>, and as such represents an X action which is to be run each time <code>runLayout</code> is called on the underlying layout, <em>after</em> <code>runLayout</code> has completed. Of course, if you override <code><a href="XMonad-Layout-LayoutModifier.html#v:redoLayout">redoLayout</a></code>, then <code><a href="XMonad-Layout-LayoutModifier.html#v:hook">hook</a></code> will not be called unless you explicitly call it. </p><p>The default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:hook">hook</a></code> is <code>return ()</code> (i.e., it has no effect). </p></div><p class="src"><a name="v:unhook" class="def">unhook</a> :: m a -> X <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/XMonad-Layout-LayoutModifier.html#unhook" class="link">Source</a></p><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:unhook">unhook</a></code> is called by the default implementation of <code><a href="XMonad-Layout-LayoutModifier.html#v:handleMess">handleMess</a></code> upon receiving a <code>Hide</code> or a <code>ReleaseResources</code> message. </p><p>The default implementation, of course, does nothing. </p></div><p class="src"><a name="v:modifierDescription" class="def">modifierDescription</a> :: m a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/XMonad-Layout-LayoutModifier.html#modifierDescription" class="link">Source</a></p><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:modifierDescription">modifierDescription</a></code> is used to give a String description to this layout modifier. It is the empty string by default; you should only override this if it is important that the presence of the layout modifier be displayed in text representations of the layout (for example, in the status bar of a <a href="XMonad-Hooks-DynamicLog.html">XMonad.Hooks.DynamicLog</a> user). </p></div><p class="src"><a name="v:modifyDescription" class="def">modifyDescription</a> :: LayoutClass l a => m a -> l a -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/XMonad-Layout-LayoutModifier.html#modifyDescription" class="link">Source</a></p><div class="doc"><p><code><a href="XMonad-Layout-LayoutModifier.html#v:modifyDescription">modifyDescription</a></code> gives a String description for the entire layout (modifier + underlying layout). By default, it is derived from the concatenation of the <code><a href="XMonad-Layout-LayoutModifier.html#v:modifierDescription">modifierDescription</a></code> with the <code>description</code> of the underlying layout, with a "smart space" in between (the space is not included if the <code><a href="XMonad-Layout-LayoutModifier.html#v:modifierDescription">modifierDescription</a></code> is empty). </p></div></div><div class="subs instances"><p id="control.i:LayoutModifier" class="caption collapser" onclick="toggleSection('i:LayoutModifier')">Instances</p><div id="section.i:LayoutModifier" class="show"><table><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> Maximize <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> Magnifier <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> WithBorder <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> NameTail a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> Named a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Layout-BoringWindows.html#t:BoringWindows">BoringWindows</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> Minimize <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> AutoMaster <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> TopRightMaster <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> CenteredMaster <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> AddRoster <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> Selection a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> LimitWindows a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> MagicFocus <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> AddMaster <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Layout-MessageControl.html#t:UnEscape">UnEscape</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Layout-Monitor.html#t:Monitor">Monitor</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> Reflect a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> Spacing a</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> a, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> a, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> a) => <a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Layout-WindowArranger.html#t:WindowArranger">WindowArranger</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Layout-ResizeScreen.html#t:ResizeScreen">ResizeScreen</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Actions-MouseResize.html#t:MouseResize">MouseResize</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Layout-BorderResize.html#t:BorderResize">BorderResize</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> ShowWName a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Actions-WorkspaceCursors.html#t:WorkspaceCursors">WorkspaceCursors</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> WorkspaceDir <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Hooks-ManageDocks.html#t:AvoidStruts">AvoidStruts</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> WindowNavigation <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> Gaps a</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> LayoutHintsToCenter <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> <a href="XMonad-Layout-LayoutHints.html#t:LayoutHints">LayoutHints</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> p, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> p, <a href="XMonad-Layout-NoBorders.html#t:SetsAmbiguous">SetsAmbiguous</a> p) => <a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> (ConfigurableBorder p) <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> (l <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a>), <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (l <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a>), LayoutClass l <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a>) => <a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> (Sublayout l) <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="XMonad-Layout-Decoration.html#t:DecorationStyle">DecorationStyle</a> ds <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a>, <a href="XMonad-Layout-Decoration.html#t:Shrinker">Shrinker</a> s) => <a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> (<a href="XMonad-Layout-Decoration.html#t:Decoration">Decoration</a> ds s) <a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Types.html#t:Window">Window</a></td><td class="doc"><p>The long <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> instance for the <code><a href="XMonad-Layout-Decoration.html#t:Decoration">Decoration</a></code> type. </p><p>In <code><a href="XMonad-Layout-LayoutModifier.html#v:redoLayout">redoLayout</a></code> we check the state: if there is no state we initialize it. </p><p>The state is <code><a href="XMonad-Layout-WindowArranger.html#v:diff">diff</a></code>ed against the list of windows produced by the underlying layout: removed windows get deleted and new ones decorated by <code>createDecos</code>, which will call <code><a href="XMonad-Layout-Decoration.html#v:decorate">decorate</a></code> to decide if a window must be given a <code><a href="/usr/share/doc/ghc/html/libraries/X11-1.5.0.0/Graphics-X11-Xlib.html#t:Rectangle">Rectangle</a></code>, in which case a decoration window will be created. </p><p>After that we resync the updated state with the windows' list and then we process the resynced stated (as we do with a new state). </p><p>First we map the decoration windows, we update each decoration to reflect any decorated window's change, and we insert, in the list of windows and rectangles returned by the underlying layout, the decoration for each window. This way xmonad will restack the decorations and their windows accordingly. At the end we remove invisible/stacked windows. </p><p>Message handling is quite simple: when needed we release the state component of the <code><a href="XMonad-Layout-Decoration.html#t:Decoration">Decoration</a></code> <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code>. Otherwise we call <code>handleEvent</code>, which will call the appropriate <code><a href="XMonad-Layout-Decoration.html#t:DecorationStyle">DecorationStyle</a></code> methods to perform its tasks. </p></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ModifiedLayout" class="def">ModifiedLayout</a> m l a <a href="src/XMonad-Layout-LayoutModifier.html#ModifiedLayout" class="link">Source</a></p><div class="doc"><p>A <code><a href="XMonad-Layout-LayoutModifier.html#t:ModifiedLayout">ModifiedLayout</a></code> is simply a container for a layout modifier combined with an underlying layout. It is, of course, itself a layout (i.e. an instance of <code>LayoutClass</code>). </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ModifiedLayout" class="def">ModifiedLayout</a> (m a) (l a)</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:ModifiedLayout" class="caption collapser" onclick="toggleSection('i:ModifiedLayout')">Instances</p><div id="section.i:ModifiedLayout" class="show"><table><tr><td class="src">(<a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a> m a, LayoutClass l a) => LayoutClass (<a href="XMonad-Layout-LayoutModifier.html#t:ModifiedLayout">ModifiedLayout</a> m l) a</td><td class="doc"><p>The <code>LayoutClass</code> instance for a <code><a href="XMonad-Layout-LayoutModifier.html#t:ModifiedLayout">ModifiedLayout</a></code> defines the semantics of a <code><a href="XMonad-Layout-LayoutModifier.html#t:LayoutModifier">LayoutModifier</a></code> applied to an underlying layout. </p></td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> (m a), <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> (l a)) => <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Read.html#t:Read">Read</a> (<a href="XMonad-Layout-LayoutModifier.html#t:ModifiedLayout">ModifiedLayout</a> m l a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (m a), <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (l a)) => <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (<a href="XMonad-Layout-LayoutModifier.html#t:ModifiedLayout">ModifiedLayout</a> m l a)</td><td class="doc empty"> </td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>