summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Main.hs5
-rw-r--r--Operations.hs9
-rw-r--r--XMonad.hs4
3 files changed, 11 insertions, 7 deletions
diff --git a/Main.hs b/Main.hs
index 0d0a442..bf1402f 100644
--- a/Main.hs
+++ b/Main.hs
@@ -42,12 +42,11 @@ main :: IO ()
main = do
dpy <- openDisplay ""
let dflt = defaultScreen dpy
- initcolor c = fst `liftM` allocNamedColor dpy (defaultColormap dpy dflt) c
rootw <- rootWindow dpy dflt
xinesc <- getScreenInfo dpy
- nbc <- initcolor normalBorderColor
- fbc <- initcolor focusedBorderColor
+ nbc <- initColor dpy normalBorderColor
+ fbc <- initColor dpy focusedBorderColor
hSetBuffering stdout NoBuffering
args <- getArgs
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
diff --git a/XMonad.hs b/XMonad.hs
index 4e20382..46ef260 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -48,8 +48,8 @@ data XState = XState
data XConf = XConf
{ display :: Display -- ^ the X11 display
, theRoot :: !Window -- ^ the root window
- , normalBorder :: !Color -- ^ border color of unfocused windows
- , focusedBorder :: !Color } -- ^ border color of the focused window
+ , normalBorder :: !Pixel -- ^ border color of unfocused windows
+ , focusedBorder :: !Pixel } -- ^ border color of the focused window
type WindowSet = StackSet WorkspaceId Window ScreenId