aboutsummaryrefslogtreecommitdiffstats
path: root/XUtils.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-10-08 14:52:06 +0200
committerDavid Roundy <droundy@darcs.net>2007-10-08 14:52:06 +0200
commit0303a3797e66fa31b4759a951ffb6f29dbb9cc57 (patch)
tree329c3fd5dd8f7ebb88e262c8c7950ca45e430b55 /XUtils.hs
parent9ff003308ac84b72d0d686df49c06164bf495565 (diff)
downloadXMonadContrib-0303a3797e66fa31b4759a951ffb6f29dbb9cc57.tar.gz
XMonadContrib-0303a3797e66fa31b4759a951ffb6f29dbb9cc57.tar.xz
XMonadContrib-0303a3797e66fa31b4759a951ffb6f29dbb9cc57.zip
make createNewWindow set background and foreground to a given color.
This means we don't need to draw colors that are this color. Also speeds up redrawing, since the X server can do all the drawing on its own, without talking with xmonad. darcs-hash:20071008125206-72aca-0f17cde109eeb8f66ea651657fcc09599680881d.gz
Diffstat (limited to 'XUtils.hs')
-rw-r--r--XUtils.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/XUtils.hs b/XUtils.hs
index c06cde4..4434c8f 100644
--- a/XUtils.hs
+++ b/XUtils.hs
@@ -66,11 +66,12 @@ releaseFont fs = do
-- | Create a simple window given a rectangle. If Nothing is given
-- only the exposureMask will be set, otherwise the Just value.
-- Use 'showWindow' to map and hideWindow to unmap.
-createNewWindow :: Rectangle -> Maybe EventMask -> X Window
-createNewWindow (Rectangle x y w h) m = do
+createNewWindow :: Rectangle -> Maybe EventMask -> String -> X Window
+createNewWindow (Rectangle x y w h) m col = do
d <- asks display
rw <- asks theRoot
- win <- io $ createSimpleWindow d rw x y w h 0 0 0
+ c <- stringToPixel col
+ win <- io $ createSimpleWindow d rw x y w h 0 c c
case m of
Just em -> io $ selectInput d win em
Nothing -> io $ selectInput d win exposureMask