From f4f0f537620208cddb90eb3f72efd15f7d9b6768 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Tue, 12 Jun 2007 17:05:55 +0200 Subject: make focus, up and down complete functions. This is a rerun of my change to make (Stack a) never be empty. Gives us more type-safety. darcs-hash:20070612150555-72aca-5f6e43aa33979c71679a73b44d93f9e2b8f9d2a8.gz --- XMonad.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'XMonad.hs') diff --git a/XMonad.hs b/XMonad.hs index df1dade..b296a38 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -16,7 +16,7 @@ module XMonad ( X, WindowSet, WorkspaceId(..), ScreenId(..), XState(..), XConf(..), Layout(..), - Typeable, Message, SomeMessage(..), fromMessage, + Typeable, Message, SomeMessage(..), fromMessage, runLayout, runX, io, catchIO, withDisplay, withWindowSet, isRoot, spawn, restart, trace, whenJust, whenX, atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW ) where @@ -111,6 +111,9 @@ atom_WM_STATE = getAtom "WM_STATE" data Layout = Layout { doLayout :: Rectangle -> Stack Window -> X [(Window, Rectangle)] , modifyLayout :: SomeMessage -> X (Maybe Layout) } +runLayout :: Layout -> Rectangle -> StackOrNot Window -> X [(Window, Rectangle)] +runLayout l r = maybe (return []) (doLayout l r) + -- Based on ideas in /An Extensible Dynamically-Typed Hierarchy of Exceptions/, -- Simon Marlow, 2006. Use extensible messages to the modifyLayout handler. -- -- cgit v1.2.3