diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-11-01 21:10:59 +0100 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-11-01 21:10:59 +0100 |
commit | 4866f2e367dfcf22a9591231ba40948826a1b438 (patch) | |
tree | 7a245caee3f146826b267d773b7eaa80386a818e /LayoutHints.hs | |
parent | 47589e1913fb9530481caedb543978a30d4323ea (diff) | |
download | XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.tar.gz XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.tar.xz XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.zip |
Hierarchify
darcs-hash:20071101201059-a5988-fc1f1262bec1b69e13ba18ae7cefeafc8c4471d4.gz
Diffstat (limited to 'LayoutHints.hs')
-rw-r--r-- | LayoutHints.hs | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/LayoutHints.hs b/LayoutHints.hs deleted file mode 100644 index 8f6f110..0000000 --- a/LayoutHints.hs +++ /dev/null @@ -1,57 +0,0 @@ -{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances #-} - ------------------------------------------------------------------------------ --- | --- Module : XMonadContrib.LayoutHints --- Copyright : (c) David Roundy <droundy@darcs.net> --- License : BSD --- --- Maintainer : David Roundy <droundy@darcs.net> --- Stability : unstable --- Portability : portable --- --- Make layouts respect size hints. ------------------------------------------------------------------------------ - -module XMonadContrib.LayoutHints ( - -- * usage - -- $usage - layoutHints, - LayoutHints) where - -import XMonad.Operations ( applySizeHints, D ) -import Graphics.X11.Xlib -import Graphics.X11.Xlib.Extras ( getWMNormalHints ) -import {-#SOURCE#-} Config (borderWidth) -import XMonad hiding ( trace ) -import XMonadContrib.LayoutModifier - --- $usage --- > import XMonadContrib.LayoutHints --- > layouts = [ layoutHints tiled , layoutHints $ Mirror tiled ] - --- %import XMonadContrib.LayoutHints --- %layout , layoutHints $ tiled --- %layout , layoutHints $ Mirror tiled - -layoutHints :: (LayoutClass l a) => l a -> ModifiedLayout LayoutHints l a -layoutHints = ModifiedLayout LayoutHints - --- | Expand a size by the given multiple of the border width. The --- multiple is most commonly 1 or -1. -adjBorders :: Dimension -> D -> D -adjBorders mult (w,h) = (w+2*mult*borderWidth, h+2*mult*borderWidth) - -data LayoutHints a = LayoutHints deriving (Read, Show) - -instance LayoutModifier LayoutHints Window where - modifierDescription _ = "Hinted" - redoLayout _ _ _ xs = do - xs' <- mapM applyHint xs - return (xs', Nothing) - where - applyHint (w,Rectangle a b c d) = - withDisplay $ \disp -> do - sh <- io $ getWMNormalHints disp w - let (c',d') = adjBorders 1 . applySizeHints sh . adjBorders (-1) $ (c,d) - return (w, Rectangle a b c' d') |