diff options
author | Lukas Mai <l.mai@web.de> | 2008-03-16 05:29:41 +0100 |
---|---|---|
committer | Lukas Mai <l.mai@web.de> | 2008-03-16 05:29:41 +0100 |
commit | 87d290b720a620bff6821f9a1fa78f8859a3f32a (patch) | |
tree | 094825f13e83608f186f0a5c2a0cedd88fc0c269 /XMonad/Layout | |
parent | 56ac39095d9588d504260981ca0609783cf836a9 (diff) | |
download | XMonadContrib-87d290b720a620bff6821f9a1fa78f8859a3f32a.tar.gz XMonadContrib-87d290b720a620bff6821f9a1fa78f8859a3f32a.tar.xz XMonadContrib-87d290b720a620bff6821f9a1fa78f8859a3f32a.zip |
Xmonad.Layout.NoBorders: make smartBorders unborder fullscreen floating windows (bug 157)
darcs-hash:20080316042941-462cf-ae5ff9d86dcd2e4110a29c4a41300aa77beda26d.gz
Diffstat (limited to '')
-rw-r--r-- | XMonad/Layout/NoBorders.hs | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/XMonad/Layout/NoBorders.hs b/XMonad/Layout/NoBorders.hs index 7bcd609..a481536 100644 --- a/XMonad/Layout/NoBorders.hs +++ b/XMonad/Layout/NoBorders.hs @@ -29,6 +29,7 @@ import XMonad import XMonad.Layout.LayoutModifier import qualified XMonad.StackSet as W import Data.List ((\\)) +import qualified Data.Map as M -- $usage -- You can use this module with the following in your ~\/.xmonad\/xmonad.hs file: @@ -72,18 +73,25 @@ instance LayoutModifier SmartBorder Window where unhook (SmartBorder s) = asks (borderWidth . config) >>= setBorders s redoLayout (SmartBorder s) _ _ wrs = do - ss <- gets (filter (nonzerorect . screenRect . W.screenDetail) . W.screens . windowset) - - if singleton ws && singleton ss - then do - asks (borderWidth . config) >>= setBorders (s \\ ws) - setBorders ws 0 - return (wrs, Just $ SmartBorder ws) - else do - asks (borderWidth . config) >>= setBorders s - return (wrs, Just $ SmartBorder []) + wset <- gets windowset + let + screens = filter (nonzerorect . screenRect . W.screenDetail) . W.screens $ wset + ws + | singleton screens = tiled ++ floating + | otherwise = [] + tiled = case wrs of + [(w, _)] -> [w] + _ -> [] + floating = + [ w | + (w, W.RationalRect px py wx wy) <- M.toList . W.floating $ wset, + px <= 0, py <= 0, + wx >= 1, wy >= 1 + ] + asks (borderWidth . config) >>= setBorders (s \\ ws) + setBorders ws 0 + return (wrs, Just $ SmartBorder ws) where - ws = map fst wrs singleton = null . drop 1 nonzerorect (Rectangle _ _ 0 0) = False nonzerorect _ = True |