mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-09 16:31:53 -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
|
import qualified Data.Traversable as T
|
||||||
|
|
||||||
|
|
||||||
data TrackFloating a = TrackFloating
|
data TrackFloating a = TrackFloating (Maybe Window)
|
||||||
{ _wasFloating :: Bool,
|
deriving (Read,Show)
|
||||||
_tiledFocus :: Maybe Window }
|
|
||||||
deriving (Read,Show,Eq)
|
|
||||||
|
|
||||||
|
|
||||||
instance LayoutModifier TrackFloating Window where
|
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
|
= do
|
||||||
winset <- gets windowset
|
winset <- gets windowset
|
||||||
let xCur = fmap W.focus xStack
|
let xCur = fmap W.focus xStack
|
||||||
@@ -71,9 +69,7 @@ instance LayoutModifier TrackFloating Window where
|
|||||||
newState | isF = mw
|
newState | isF = mw
|
||||||
| otherwise = xCur
|
| otherwise = xCur
|
||||||
ran <- runLayout ws{ W.stack = newStack } r
|
ran <- runLayout ws{ W.stack = newStack } r
|
||||||
return (ran,
|
return (ran, guard (newState /= mw) >> Just (TrackFloating newState))
|
||||||
let n = TrackFloating isF newState
|
|
||||||
in guard (n /= os) >> Just n)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -142,7 +138,7 @@ window regardless of which tiled window was focused before.
|
|||||||
|
|
||||||
-}
|
-}
|
||||||
trackFloating :: l a -> ModifiedLayout TrackFloating l a
|
trackFloating :: l a -> ModifiedLayout TrackFloating l a
|
||||||
trackFloating layout = ModifiedLayout (TrackFloating False Nothing) layout
|
trackFloating layout = ModifiedLayout (TrackFloating Nothing) layout
|
||||||
|
|
||||||
{- $layoutModifier
|
{- $layoutModifier
|
||||||
It also corrects focus issues for full-like layouts inside other layout
|
It also corrects focus issues for full-like layouts inside other layout
|
||||||
|
Reference in New Issue
Block a user