X.L.TrackFloating: Drop redundant _wasFloating

It was added in 81d338952d in an attempt to fix focus handling after
closing a floating window, but shortly after made redundant in
a551d1367c when we noticed it causes more harm than good. Unfortunately
it wasn't fully reverted, making the code more complex than necessary.

Drop the remaining bits.

Now it's almost obvious that the only difference between this and
X.L.StateFull.FocusTracking is the isF condition.

BTW the original issue 81d338952d was trying to fix can be fixed by
using X.H.RefocusLast, from the author of X.L.StateFull.FocusTracking.
:-)
This commit is contained in:
Tomas Janousek
2020-12-08 23:20:05 +00:00
parent 8afd51517c
commit 0e9c865e72

View File

@@ -47,14 +47,12 @@ import qualified XMonad.StackSet as W
import qualified Data.Traversable as T
data TrackFloating a = TrackFloating
{ _wasFloating :: Bool,
_tiledFocus :: Maybe Window }
deriving (Read,Show,Eq)
data TrackFloating a = TrackFloating (Maybe Window)
deriving (Read,Show)
instance LayoutModifier TrackFloating Window where
modifyLayoutWithUpdate os@(TrackFloating _wasF mw) ws@(W.Workspace{ W.stack = ms }) r
modifyLayoutWithUpdate (TrackFloating mw) ws@(W.Workspace{ W.stack = ms }) r
= do
winset <- gets windowset
let xCur = fmap W.focus xStack
@@ -71,9 +69,7 @@ instance LayoutModifier TrackFloating Window where
newState | isF = mw
| otherwise = xCur
ran <- runLayout ws{ W.stack = newStack } r
return (ran,
let n = TrackFloating isF newState
in guard (n /= os) >> Just n)
return (ran, guard (newState /= mw) >> Just (TrackFloating newState))
@@ -142,7 +138,7 @@ window regardless of which tiled window was focused before.
-}
trackFloating :: l a -> ModifiedLayout TrackFloating l a
trackFloating layout = ModifiedLayout (TrackFloating False Nothing) layout
trackFloating layout = ModifiedLayout (TrackFloating Nothing) layout
{- $layoutModifier
It also corrects focus issues for full-like layouts inside other layout