aboutsummaryrefslogtreecommitdiffstats
path: root/LayoutScreens.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-09-06 14:55:43 +0200
committerDavid Roundy <droundy@darcs.net>2007-09-06 14:55:43 +0200
commit2f529702a9c77136c8c58a9192b07bee523e573f (patch)
tree09363de8cbdf364b64183c23720bc15271d89c92 /LayoutScreens.hs
parent21bae500490d36073f0933b907a2c1dbd41d3de2 (diff)
downloadXMonadContrib-2f529702a9c77136c8c58a9192b07bee523e573f.tar.gz
XMonadContrib-2f529702a9c77136c8c58a9192b07bee523e573f.tar.xz
XMonadContrib-2f529702a9c77136c8c58a9192b07bee523e573f.zip
add function and comment assisting use in resizing the screen.
darcs-hash:20070906125543-72aca-8cf6a1adc15e24be24f1368a96e424d97606f02d.gz
Diffstat (limited to 'LayoutScreens.hs')
-rw-r--r--LayoutScreens.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/LayoutScreens.hs b/LayoutScreens.hs
index a78a402..2961b8b 100644
--- a/LayoutScreens.hs
+++ b/LayoutScreens.hs
@@ -13,7 +13,7 @@
module XMonadContrib.LayoutScreens (
-- * Usage
-- $usage
- layoutScreens
+ layoutScreens, fixedLayout
) where
import Control.Monad.Reader ( asks )
@@ -39,6 +39,16 @@ import Graphics.X11.Xlib.Extras
--
-- > , ((modMask .|. shiftMask, xK_space), layoutScreens 2 (twoPane 0.5 0.5))
-- > , ((controlMask .|. modMask .|. shiftMask, xK_space), rescreen)
+--
+-- Another example use would be to handle a scenario where xrandr didn't
+-- work properly (e.g. a VNC X server in my case) and you want to be able
+-- to resize your screen (e.g. to match the size of a remote VNC client):
+--
+-- > import XMonadContrib.LayoutScreens
+--
+-- > , ((modMask .|. shiftMask, xK_space),
+-- > layoutScreens 1 (fixedLayout $ Rectangle 0 0 1024 768))
+-- > , ((controlMask .|. modMask .|. shiftMask, xK_space), rescreen)
-- %import XMonadContrib.LayoutScreens
-- %keybind , ((modMask .|. shiftMask, xK_space), layoutScreens 2 (twoPane 0.5 0.5))
@@ -62,3 +72,7 @@ getWindowRectangle w = withDisplay $ \d ->
do a <- io $ getWindowAttributes d w
return $ Rectangle (fromIntegral $ wa_x a) (fromIntegral $ wa_y a)
(fromIntegral $ wa_width a) (fromIntegral $ wa_height a)
+
+fixedLayout :: Rectangle -> Layout a
+fixedLayout r = Layout { doLayout = \_ (W.Stack f _ _) -> return ([(f, r)],Nothing)
+ , modifyLayout = const (return Nothing) } -- no changes