mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 12:41:52 -07:00
X.L.TrackFloating: Drop redundant _wasFloating
It was added in81d338952d
in an attempt to fix focus handling after closing a floating window, but shortly after made redundant ina551d1367c
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 issue81d338952d
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user