diff options
author | David Roundy <droundy@darcs.net> | 2007-10-29 19:48:23 +0100 |
---|---|---|
committer | David Roundy <droundy@darcs.net> | 2007-10-29 19:48:23 +0100 |
commit | 2c21308fc9cafa27ab95b38bd3712f5b7939fa37 (patch) | |
tree | 14a244b45dafe28e98187f6cd512c0c008adfb23 /Operations.hs | |
parent | 2c5514f5ce7ee5724d7bcfa6e04f43fa7a276ee8 (diff) | |
download | xmonad-2c21308fc9cafa27ab95b38bd3712f5b7939fa37.tar.gz xmonad-2c21308fc9cafa27ab95b38bd3712f5b7939fa37.tar.xz xmonad-2c21308fc9cafa27ab95b38bd3712f5b7939fa37.zip |
cleaner version of main/config inversion.
darcs-hash:20071029184823-72aca-5647e07a0bde65cf7e1d49a1613fb9e4210c6aa5.gz
Diffstat (limited to '')
-rw-r--r-- | Operations.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Operations.hs b/Operations.hs index 8dbb5b4..ae5cd39 100644 --- a/Operations.hs +++ b/Operations.hs @@ -37,7 +37,7 @@ import Graphics.X11.Xlib import Graphics.X11.Xinerama (getScreenInfo) import Graphics.X11.Xlib.Extras -import {-# SOURCE #-} Main (borderWidth,logHook,manageHook,numlockMask,serialisedLayouts) +import {-# SOURCE #-} Main (manageHook,numlockMask,serialisedLayouts) -- --------------------------------------------------------------------- -- | @@ -170,7 +170,7 @@ windows f = do whenJust (W.peek ws) $ \w -> io $ setWindowBorder d w fbc setTopFocus - userCode logHook + asks logHook >>= userCode -- io performGC -- really helps, but seems to trigger GC bugs? -- hide every window that was potentially visible before, but is not @@ -214,7 +214,8 @@ setInitialProperties :: Window -> X () setInitialProperties w = asks normalBorder >>= \nb -> withDisplay $ \d -> do setWMState w iconicState io $ selectInput d w $ clientMask - io $ setWindowBorderWidth d w borderWidth + bw <- asks borderWidth + io $ setWindowBorderWidth d w bw -- we must initially set the color of new windows, to maintain invariants -- required by the border setting in 'windows' io $ setWindowBorder d w nb @@ -543,11 +544,11 @@ floatLocation :: Window -> X (ScreenId, W.RationalRect) floatLocation w = withDisplay $ \d -> do ws <- gets windowset wa <- io $ getWindowAttributes d w + bw <- fi `fmap` asks borderWidth -- XXX horrible let sc = fromMaybe (W.current ws) $ find (pointWithin (fi $ wa_x wa) (fi $ wa_y wa) . screenRect . W.screenDetail) $ W.screens ws sr = screenRect . W.screenDetail $ sc - bw = fi borderWidth rr = W.RationalRect ((fi (wa_x wa) - fi (rect_x sr)) % fi (rect_width sr)) ((fi (wa_y wa) - fi (rect_y sr)) % fi (rect_height sr)) (fi (wa_width wa + bw*2) % fi (rect_width sr)) |