aboutsummaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorJason Creighton <jcreigh@gmail.com>2007-06-14 01:45:01 +0200
committerJason Creighton <jcreigh@gmail.com>2007-06-14 01:45:01 +0200
commitca00fbd50f9c4b6a6dbbb9ec7bb525b459a4612b (patch)
tree4de8b9bc920c610af0322dbb6875392d35fa3990 /Operations.hs
parentff9757d5d1240ccf646635dc5e0777095fad057f (diff)
downloadxmonad-ca00fbd50f9c4b6a6dbbb9ec7bb525b459a4612b.tar.gz
xmonad-ca00fbd50f9c4b6a6dbbb9ec7bb525b459a4612b.tar.xz
xmonad-ca00fbd50f9c4b6a6dbbb9ec7bb525b459a4612b.zip
move initColor to Operations and only store the Pixel value of colors
Moving initColor to Operations allows it to be used by extensions. The Pixel component of the color is the only thing we need, so it's simpler just to deal with that. darcs-hash:20070613234501-b9aa7-5b39416db9f9d5ac42692262c233179baeb2540f.gz
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Operations.hs b/Operations.hs
index 600e1e6..f569c08 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -320,13 +320,13 @@ setFocusX w = withWindowSet $ \ws -> do
forM_ (W.current ws : W.visible ws) $ \wk -> do
forM_ (W.index (W.view (W.tag (W.workspace wk)) ws)) $ \otherw -> do
setButtonGrab True otherw
- io $ setWindowBorder dpy otherw (color_pixel nbc)
+ io $ setWindowBorder dpy otherw nbc
-- If we ungrab buttons on the root window, we lose our mouse bindings.
whenX (not `liftM` isRoot w) $ setButtonGrab False w
io $ do setInputFocus dpy w revertToPointerRoot 0
-- raiseWindow dpy w
- io $ setWindowBorder dpy w (color_pixel fbc)
+ io $ setWindowBorder dpy w fbc
-- ---------------------------------------------------------------------
-- Managing layout
@@ -478,6 +478,11 @@ extraModifiers = [0, numlockMask, lockMask, numlockMask .|. lockMask ]
cleanMask :: KeyMask -> KeyMask
cleanMask = (complement (numlockMask .|. lockMask) .&.)
+-- | Get the Pixel value for a named color
+initColor :: Display -> String -> IO Pixel
+initColor dpy c = (color_pixel . fst) `liftM` allocNamedColor dpy colormap c
+ where colormap = defaultColormap dpy (defaultScreen dpy)
+
------------------------------------------------------------------------
-- | Floating layer support