From 897a7213b02a495459dc4d8268b792da2562a506 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Tue, 2 Oct 2007 23:30:53 +0200 Subject: NoBorders: reduce flicker darcs-hash:20071002213053-a5988-39f5f90d0e14a23fc5def20d19c0701117a99513.gz --- NoBorders.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'NoBorders.hs') diff --git a/NoBorders.hs b/NoBorders.hs index 96c2586..a8554d5 100644 --- a/NoBorders.hs +++ b/NoBorders.hs @@ -32,6 +32,7 @@ import XMonad import XMonadContrib.LayoutModifier import {-# SOURCE #-} Config (borderWidth) import qualified StackSet as W +import Data.List ((\\)) -- $usage -- You can use this module with the following in your Config.hs file: @@ -57,7 +58,7 @@ instance LayoutModifier WithBorder Window where unhook (WithBorder _ s) = setBorders borderWidth s redoLayout (WithBorder n s) _ stack wrs = do - setBorders borderWidth s + setBorders borderWidth (ws \\ s) setBorders n ws return (wrs, Just $ WithBorder n ws) where @@ -81,11 +82,15 @@ instance LayoutModifier SmartBorder Window where redoLayout (SmartBorder s) _ stack wrs = do ss <- gets (W.screens . windowset) - setBorders borderWidth s if singleton ws && singleton ss - then do setBorders 0 ws; return (wrs, Just $ SmartBorder ws) - else return (wrs, Just $ SmartBorder []) + then do + setBorders borderWidth (s \\ ws) + setBorders 0 ws + return (wrs, Just $ SmartBorder ws) + else do + setBorders borderWidth s + return (wrs, Just $ SmartBorder []) where ws = map fst wrs singleton = null . drop 1 -- cgit v1.2.3