<!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.Actions.Navigation2D</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-Actions-Navigation2D.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Actions-Navigation2D.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.11: Third party extensions for xmonad</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>unportable</td></tr><tr><th>Stability</th><td>unstable</td></tr><tr><th>Maintainer</th><td>Norbert Zeh <nzeh@cs.dal.ca></td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">XMonad.Actions.Navigation2D</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">Finer points </a></li><li><a href="#g:3">Alternative directional navigation modules </a></li><li><a href="#g:4">Incompatibilities </a></li><li><a href="#g:5">Detailed technical discussion </a></li><li><a href="#g:6">Exported functions and types </a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Navigation2D is an xmonad extension that allows easy directional navigation of windows and screens (in a multi-monitor setup). </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"><a href="#v:withNavigation2DConfig">withNavigation2DConfig</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> a -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> a</li><li class="src short"><span class="keyword">data</span> <a href="#t:Navigation2DConfig">Navigation2DConfig</a> = <a href="#v:Navigation2DConfig">Navigation2DConfig</a> {<ul class="subs"><li><a href="#v:defaultTiledNavigation">defaultTiledNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></li><li><a href="#v:floatNavigation">floatNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></li><li><a href="#v:screenNavigation">screenNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></li><li><a href="#v:layoutNavigation">layoutNavigation</a> :: [(<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>, <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a>)]</li><li><a href="#v:unmappedWindowRect">unmappedWindowRect</a> :: [(<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>, Screen -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a>))]</li></ul>}</li><li class="src short"><a href="#v:defaultNavigation2DConfig">defaultNavigation2DConfig</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Navigation2D">Navigation2D</a> </li><li class="src short"><a href="#v:lineNavigation">lineNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></li><li class="src short"><a href="#v:centerNavigation">centerNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></li><li class="src short"><a href="#v:fullScreenRect">fullScreenRect</a> :: Screen -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a>)</li><li class="src short"><a href="#v:singleWindowRect">singleWindowRect</a> :: Screen -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a>)</li><li class="src short"><a href="#v:switchLayer">switchLayer</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:windowGo">windowGo</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:windowSwap">windowSwap</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:windowToScreen">windowToScreen</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:screenGo">screenGo</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:screenSwap">screenSwap</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Direction2D">Direction2D</a> <ul class="subs"><li>= <a href="#v:U">U</a> </li><li>| <a href="#v:D">D</a> </li><li>| <a href="#v:R">R</a> </li><li>| <a href="#v:L">L</a> </li></ul></li></ul></div><div id="interface"><h1 id="g:1">Usage </h1><div class="doc"><p><a name="Usage"></a> Navigation2D provides directional navigation (go left, right, up, down) for windows and screens. It treats floating and tiled windows as two separate layers and provides mechanisms to navigate within each layer and to switch between layers. Navigation2D provides two different navigation strategies (see <a href="#Technical_Discussion">#Technical_Discussion</a> for details): <em>Line navigation</em> feels rather natural but may make it impossible to navigate to a given window from the current window, particularly in the floating layer. <em>Center navigation</em> feels less natural in certain situations but ensures that all windows can be reached without the need to involve the mouse. Navigation2D allows different navigation strategies to be used in the two layers and allows customization of the navigation strategy for the tiled layer based on the layout currently in effect. </p><p>You can use this module with (a subset of) the following in your <code>~/.xmonad/xmonad.hs</code>: </p><pre> import XMonad.Actions.Navigation2D </pre><p>Then edit your keybindings: </p><pre> -- Switch between layers , ((modm, xK_space), switchLayers) -- Directional navigation of windows , ((modm, xK_Right), windowGo R False) , ((modm, xK_Left ), windowGo L False) , ((modm, xK_Up ), windowGo U False) , ((modm, xK_Down ), windowGo D False) -- Swap adjacent windows , ((modm .|. controlMask, xK_Right), windowSwap R False) , ((modm .|. controlMask, xK_Left ), windowSwap L False) , ((modm .|. controlMask, xK_Up ), windowSwap U False) , ((modm .|. controlMask, xK_Down ), windowSwap D False) -- Directional navigation of screens , ((modm, xK_r ), screenGo R False) , ((modm, xK_l ), screenGo L False) , ((modm, xK_u ), screenGo U False) , ((modm, xK_d ), screenGo D False) -- Swap workspaces on adjacent screens , ((modm .|. controlMask, xK_r ), screenSwap R False) , ((modm .|. controlMask, xK_l ), screenSwap L False) , ((modm .|. controlMask, xK_u ), screenSwap U False) , ((modm .|. controlMask, xK_d ), screenSwap D False) -- Send window to adjacent screen , ((modm .|. mod1Mask, xK_r ), windowToScreen R False) , ((modm .|. mod1Mask, xK_l ), windowToScreen L False) , ((modm .|. mod1Mask, xK_u ), windowToScreen U False) , ((modm .|. mod1Mask, xK_d ), windowToScreen D False) </pre><p>and add the configuration of the module to your main function: </p><pre> main = xmonad $ withNavigation2DConfig defaultNavigation2DConfig $ defaultConfig </pre><p>For detailed instruction on editing the key binding see: </p><p><a href="XMonad-Doc-Extending.html#Editing_key_bindings">XMonad.Doc.Extending</a>. </p></div><h1 id="g:2">Finer points </h1><div class="doc"><p><a name="Finer_Points"></a> The above should get you started. Here are some finer points: </p><p>Navigation2D has the ability to wrap around at screen edges. For example, if you navigated to the rightmost window on the rightmost screen and you continued to go right, this would get you to the leftmost window on the leftmost screen. This feature may be useful for switching between screens that are far apart but may be confusing at least to novice users. Therefore, it is disabled in the above example (e.g., navigation beyond the rightmost window on the rightmost screen is not possible and trying to do so will simply not do anything.) If you want this feature, change all the <code><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#v:False">False</a></code> values in the above example to <code><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#v:True">True</a></code>. You could also decide you want wrapping only for a subset of the operations and no wrapping for others. </p><p>By default, all layouts use the <code><a href="XMonad-Actions-Navigation2D.html#v:defaultTiledNavigation">defaultTiledNavigation</a></code> strategy specified in the <code><a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a></code> (by default, line navigation is used). To override this behaviour for some layouts, add a pair ("layout name", navigation strategy) to the <code><a href="XMonad-Actions-Navigation2D.html#v:layoutNavigation">layoutNavigation</a></code> list in the <code><a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a></code>, where "layout name" is the string reported by the layout's description method (normally what is shown as the layout name in your status bar). For example, all navigation strategies normally allow only navigation between mapped windows. The first step to overcome this, for example, for the Full layout, is to switch to center navigation for the Full layout: </p><pre> myNavigation2DConfig = defaultNavigation2DConfig { layoutNavigation = [("Full", centerNavigation)] } main = xmonad $ withNavigation2DConfig myNavigation2DConfig $ defaultConfig </pre><p>The navigation between windows is based on their screen rectangles, which are available <em>and meaningful</em> only for mapped windows. Thus, as already said, the default is to allow navigation only between mapped windows. However, there are layouts that do not keep all windows mapped. One example is the Full layout, which unmaps all windows except the one that has the focus, thereby preventing navigation to any other window in the layout. To make navigation to unmapped windows possible, unmapped windows need to be assigned rectangles to pretend they are mapped, and a natural way to do this for the Full layout is to pretend all windows occupy the full screen and are stacked on top of each other so that only the frontmost one is visible. This can be done as follows: </p><pre> myNavigation2DConfig = defaultNavigation2DConfig { layoutNavigation = [("Full", centerNavigation)] , unmappedWindowRect = [("Full", singleWindowRect)] } main = xmonad $ withNavigation2DConfig myNavigation2DConfig $ defaultConfig </pre><p>With this setup, Left/Up navigation behaves like standard <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#v:focusUp">focusUp</a></code> and Right/Down navigation behaves like <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#v:focusDown">focusDown</a></code>, thus allowing navigation between windows in the layout. </p><p>In general, each entry in the <code><a href="XMonad-Actions-Navigation2D.html#v:unmappedWindowRect">unmappedWindowRect</a></code> association list is a pair ("layout description", function), where the function computes a rectangle for each unmapped window from the screen it is on and the window ID. Currently, Navigation2D provides only two functions of this type: <code><a href="XMonad-Actions-Navigation2D.html#v:singleWindowRect">singleWindowRect</a></code> and <code><a href="XMonad-Actions-Navigation2D.html#v:fullScreenRect">fullScreenRect</a></code>. </p><p>With per-layout navigation strategies, if different layouts are in effect on different screens in a multi-monitor setup, and different navigation strategies are defined for these active layouts, the most general of these navigation strategies is used across all screens (because Navigation2D does not distinguish between windows on different workspaces), where center navigation is more general than line navigation, as discussed formally under <a href="#Technical_Discussion">#Technical_Discussion</a>. </p></div><h1 id="g:3">Alternative directional navigation modules </h1><div class="doc"><p><a name="Alternatives"></a> </p><p>There exist two alternatives to Navigation2D: <a href="XMonad-Actions-WindowNavigation.html">XMonad.Actions.WindowNavigation</a> and <a href="XMonad-Layout-WindowNavigation.html">XMonad.Layout.WindowNavigation</a>. X.L.WindowNavigation has the advantage of colouring windows to indicate the window that would receive the focus in each navigation direction, but it does not support navigation across multiple monitors, does not support directional navigation of floating windows, and has a very unintuitive definition of which window receives the focus next in each direction. X.A.WindowNavigation does support navigation across multiple monitors but does not provide window colouring while retaining the unintuitive navigational semantics of X.L.WindowNavigation. This makes it very difficult to predict which window receives the focus next. Neither X.A.WindowNavigation nor X.L.WindowNavigation supports directional navigation of screens. </p></div><h1 id="g:4">Incompatibilities </h1><div class="doc"><p><a name="Incompatibilities"></a> Currently Navigation2D is known not to play nicely with tabbed layouts, but it should work well with any other tiled layout. My hope is to address the incompatibility with tabbed layouts in a future version. The navigation to unmapped windows, for example in a Full layout, by assigning rectangles to unmapped windows is more a workaround than a clean solution. Figuring out how to deal with tabbed layouts may also lead to a more general and cleaner solution to query the layout for a window's rectangle that may make this workaround unnecessary. At that point, the <code><a href="XMonad-Actions-Navigation2D.html#v:unmappedWindowRect">unmappedWindowRect</a></code> field of the <code><a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a></code> will disappear. </p></div><h1 id="g:5">Detailed technical discussion </h1><div class="doc"><p><a name="Technical_Discussion"></a> An in-depth discussion of the navigational strategies implemented in Navigation2D, including formal proofs of their properties, can be found at <a href="http://www.cs.dal.ca/~nzeh/xmonad/Navigation2D.pdf">http://www.cs.dal.ca/~nzeh/xmonad/Navigation2D.pdf</a>. </p></div><h1 id="g:6">Exported functions and types </h1><div class="top"><p class="src"><a name="v:withNavigation2DConfig" class="def">withNavigation2DConfig</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> a -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:XConfig">XConfig</a> a<a href="src/XMonad-Actions-Navigation2D.html#withNavigation2DConfig" class="link">Source</a></p><div class="doc"><p>Modifies the xmonad configuration to store the Navigation2D configuration </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Navigation2DConfig" class="def">Navigation2DConfig</a> <a href="src/XMonad-Actions-Navigation2D.html#Navigation2DConfig" class="link">Source</a></p><div class="doc"><p>Stores the configuration of directional navigation </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Navigation2DConfig" class="def">Navigation2DConfig</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:defaultTiledNavigation" class="def">defaultTiledNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></dt><dd class="doc"><p>default navigation strategy for the tiled layer </p></dd><dt class="src"><a name="v:floatNavigation" class="def">floatNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></dt><dd class="doc"><p>navigation strategy for the float layer </p></dd><dt class="src"><a name="v:screenNavigation" class="def">screenNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></dt><dd class="doc"><p>strategy for navigation between screens </p></dd><dt class="src"><a name="v:layoutNavigation" class="def">layoutNavigation</a> :: [(<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>, <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a>)]</dt><dd class="doc"><p>association list of customized navigation strategies for different layouts in the tiled layer. Each pair is of the form ("layout description", navigation strategy). If there is no pair in this list whose first component is the name of the current layout, the <code><a href="XMonad-Actions-Navigation2D.html#v:defaultTiledNavigation">defaultTiledNavigation</a></code> strategy is used. </p></dd><dt class="src"><a name="v:unmappedWindowRect" class="def">unmappedWindowRect</a> :: [(<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>, Screen -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a>))]</dt><dd class="doc"><p>list associating functions to calculate rectangles for unmapped windows with layouts to which they are to be applied. Each pair in this list is of the form ("layout description", function), where the function calculates a rectangle for a given unmapped window from the screen it is on and its window ID. See <a href="#Finer_Points">#Finer_Points</a> for how to use this. </p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Navigation2DConfig" class="caption collapser" onclick="toggleSection('i:Navigation2DConfig')">Instances</p><div id="section.i:Navigation2DConfig" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ExtensionClass">ExtensionClass</a> <a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:defaultNavigation2DConfig" class="def">defaultNavigation2DConfig</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2DConfig">Navigation2DConfig</a><a href="src/XMonad-Actions-Navigation2D.html#defaultNavigation2DConfig" class="link">Source</a></p><div class="doc"><p>Default navigation configuration. It uses line navigation for the tiled layer and for navigation between screens, and center navigation for the float layer. No custom navigation strategies or rectangles for unmapped windows are defined for individual layouts. </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Navigation2D" class="def">Navigation2D</a> <a href="src/XMonad-Actions-Navigation2D.html#Navigation2D" class="link">Source</a></p><div class="doc"><p>Encapsulates the navigation strategy </p></div><div class="subs instances"><p id="control.i:Navigation2D" class="caption collapser" onclick="toggleSection('i:Navigation2D')">Instances</p><div id="section.i:Navigation2D" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Ord.html#t:Ord">Ord</a> <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:lineNavigation" class="def">lineNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a><a href="src/XMonad-Actions-Navigation2D.html#lineNavigation" class="link">Source</a></p><div class="doc"><p>Line navigation. To illustrate this navigation strategy, consider navigating to the left from the current window. In this case, we draw a horizontal line through the center of the current window and consider all windows that intersect this horizontal line and whose right boundaries are to the left of the left boundary of the current window. From among these windows, we choose the one with the rightmost right boundary. </p></div></div><div class="top"><p class="src"><a name="v:centerNavigation" class="def">centerNavigation</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Navigation2D">Navigation2D</a><a href="src/XMonad-Actions-Navigation2D.html#centerNavigation" class="link">Source</a></p><div class="doc"><p>Center navigation. Again, consider navigating to the left. Then we consider the cone bounded by the two rays shot at 45-degree angles in north-west and south-west direction from the center of the current window. A window is a candidate to receive the focus if its center lies in this cone. We choose the window whose center has minimum L1-distance from the current window center. The tie breaking strategy for windows with the same distance is a bit complicated (see <a href="#Technical_Discussion">#Technical_Discussion</a>) but ensures that all windows can be reached and that windows with the same center are traversed in their order in the window stack, that is, in the order <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#v:focusUp">focusUp</a></code> and <code><a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#v:focusDown">focusDown</a></code> would traverse them. </p></div></div><div class="top"><p class="src"><a name="v:fullScreenRect" class="def">fullScreenRect</a> :: Screen -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a>)<a href="src/XMonad-Actions-Navigation2D.html#fullScreenRect" class="link">Source</a></p><div class="doc"><p>Maps each window to a fullscreen rect. This may not be the same rectangle the window maps to under the Full layout or a similar layout if the layout respects statusbar struts. In such cases, it may be better to use <code><a href="XMonad-Actions-Navigation2D.html#v:singleWindowRect">singleWindowRect</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:singleWindowRect" class="def">singleWindowRect</a> :: Screen -> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Types.html#t:Window">Window</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/X11-1.6.0/Graphics-X11-Xlib-Types.html#t:Rectangle">Rectangle</a>)<a href="src/XMonad-Actions-Navigation2D.html#singleWindowRect" class="link">Source</a></p><div class="doc"><p>Maps each window to the rectangle it would receive if it was the only window in the layout. Useful, for example, for determining the default rectangle for unmapped windows in a Full layout that respects statusbar struts. </p></div></div><div class="top"><p class="src"><a name="v:switchLayer" class="def">switchLayer</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-Navigation2D.html#switchLayer" class="link">Source</a></p><div class="doc"><p>Switches focus to the closest window in the other layer (floating if the current window is tiled, tiled if the current window is floating). Closest means that the L1-distance between the centers of the windows is minimized. </p></div></div><div class="top"><p class="src"><a name="v:windowGo" class="def">windowGo</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-Navigation2D.html#windowGo" class="link">Source</a></p><div class="doc"><p>Moves the focus to the next window in the given direction and in the same layer as the current window. The second argument indicates whether navigation should wrap around (e.g., from the left edge of the leftmost screen to the right edge of the rightmost screen). </p></div></div><div class="top"><p class="src"><a name="v:windowSwap" class="def">windowSwap</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-Navigation2D.html#windowSwap" class="link">Source</a></p><div class="doc"><p>Swaps the current window with the next window in the given direction and in the same layer as the current window. (In the floating layer, all that changes for the two windows is their stacking order if they're on the same screen. If they're on different screens, each window is moved to the other window's screen but retains its position and size relative to the screen.) The second argument indicates wrapping (see <code><a href="XMonad-Actions-Navigation2D.html#v:windowGo">windowGo</a></code>). </p></div></div><div class="top"><p class="src"><a name="v:windowToScreen" class="def">windowToScreen</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-Navigation2D.html#windowToScreen" class="link">Source</a></p><div class="doc"><p>Moves the current window to the next screen in the given direction. The second argument indicates wrapping (see <code><a href="XMonad-Actions-Navigation2D.html#v:windowGo">windowGo</a></code>). </p></div></div><div class="top"><p class="src"><a name="v:screenGo" class="def">screenGo</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-Navigation2D.html#screenGo" class="link">Source</a></p><div class="doc"><p>Moves the focus to the next screen in the given direction. The second argument indicates wrapping (see <code><a href="XMonad-Actions-Navigation2D.html#v:windowGo">windowGo</a></code>). </p></div></div><div class="top"><p class="src"><a name="v:screenSwap" class="def">screenSwap</a> :: <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Actions-Navigation2D.html#screenSwap" class="link">Source</a></p><div class="doc"><p>Swaps the workspace on the current screen with the workspace on the screen in the given direction. The second argument indicates wrapping (see <code><a href="XMonad-Actions-Navigation2D.html#v:windowGo">windowGo</a></code>). </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Direction2D" class="def">Direction2D</a> <a href="src/XMonad-Util-Types.html#Direction2D" class="link">Source</a></p><div class="doc"><p>Two-dimensional directions: </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:U" class="def">U</a></td><td class="doc"><p>Up </p></td></tr><tr><td class="src"><a name="v:D" class="def">D</a></td><td class="doc"><p>Down </p></td></tr><tr><td class="src"><a name="v:R" class="def">R</a></td><td class="doc"><p>Right </p></td></tr><tr><td class="src"><a name="v:L" class="def">L</a></td><td class="doc"><p>Left </p></td></tr></table></div><div class="subs instances"><p id="control.i:Direction2D" class="caption collapser" onclick="toggleSection('i:Direction2D')">Instances</p><div id="section.i:Direction2D" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Bounded">Bounded</a> <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html#t:Enum">Enum</a> <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Ord.html#t:Ord">Ord</a> <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Text-Read.html#t:Read">Read</a> <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Text-Show.html#t:Show">Show</a> <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="XMonad-Actions-Navigation2D.html#t:Direction2D">Direction2D</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.10.0</p></div></body></html>