summaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorJason Creighton <jcreigh@gmail.com>2007-04-30 06:38:59 +0200
committerJason Creighton <jcreigh@gmail.com>2007-04-30 06:38:59 +0200
commitd2606cda76d70124278df46293d9d40d5cdbe537 (patch)
tree500f4beeb8fc6d2420a9e4c5ab2d1cc99595fed3 /Operations.hs
parent904630eb205fb37ee3526148efc2391829088541 (diff)
downloadmetatile-d2606cda76d70124278df46293d9d40d5cdbe537.tar
metatile-d2606cda76d70124278df46293d9d40d5cdbe537.zip
configurable border colors
This also fixes a bug where xmonad was assuming a 24-bit display, and just using, eg, 0xff0000 as an index into a colormap without querying the X server to determine the proper pixel value for "red". darcs-hash:20070430043859-b9aa7-9467ff583ec95144e5baa088e4b1536a725e7bc6
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/Operations.hs b/Operations.hs
index 4346398..49094d1 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -189,17 +189,18 @@ safeFocus w = do ws <- gets workspace
-- | Explicitly set the keyboard focus to the given window
setFocus :: Window -> X ()
setFocus w = do
- ws <- gets workspace
+ XState { workspace = ws, display = dpy
+ , normalBorder = nbc, focusedBorder = fbc } <- get
-- clear mouse button grab and border on other windows
flip mapM_ (W.visibleWorkspaces ws) $ \n -> do
flip mapM_ (W.index n ws) $ \otherw -> do
setButtonGrab True otherw
- setBorder otherw 0xdddddd
+ io $ setWindowBorder dpy otherw (color_pixel nbc)
withDisplay $ \d -> io $ setInputFocus d w revertToPointerRoot 0
setButtonGrab False w
- setBorder w 0xff0000 -- make this configurable
+ io $ setWindowBorder dpy w (color_pixel fbc)
-- This does not use 'windows' intentionally. 'windows' calls refresh,
-- which means infinite loops.
@@ -213,10 +214,6 @@ setTopFocus = do
Just new -> setFocus new
Nothing -> gets theRoot >>= setFocus
--- | Set the border color for a particular window.
-setBorder :: Window -> Pixel -> X ()
-setBorder w p = withDisplay $ \d -> io $ setWindowBorder d w p
-
-- | raise. focus to window at offset 'n' in list.
-- The currently focused window is always the head of the list
raise :: Ordering -> X ()