This commit is contained in:
Leon Kowarschick 2020-06-21 11:56:08 +02:00
parent 4e64f432c9
commit cb9acf26e0
4 changed files with 13 additions and 19 deletions

View file

@ -23,9 +23,9 @@ import qualified XMonad.Util.ExtensibleState as XS
import qualified Rofi import qualified Rofi
import qualified DescribedSubmap import qualified DescribedSubmap
import qualified TiledDragging import qualified TiledDragging
import qualified WindowSwallowing --import qualified WindowSwallowing
--import XMonad.Hooks.WindowSwallowing as WindowSwallowing import XMonad.Hooks.WindowSwallowing as WindowSwallowing
import Data.Foldable ( for_ ) import Data.Foldable ( for_ )

View file

@ -102,11 +102,7 @@ swallowEventHook parentQueries childQueries event = do
windows windows
( W.modify' (\x -> x { W.focus = childWindow }) ( W.modify' (\x -> x { W.focus = childWindow })
. copyFloatingState parentWindow childWindow . moveFloatingState parentWindow childWindow
)
windows
(\ws ->
ws { W.floating = M.delete parentWindow (W.floating ws) }
) )
XS.modify (addSwallowedParent parentWindow childWindow) XS.modify (addSwallowedParent parentWindow childWindow)
_ -> return () _ -> return ()
@ -142,12 +138,9 @@ swallowEventHook parentQueries childQueries event = do
(\ws -> (\ws ->
updateCurrentStack updateCurrentStack
(const $ Just $ oldStack { W.focus = parent }) (const $ Just $ oldStack { W.focus = parent })
$ copyFloatingState childWindow parent $ moveFloatingState childWindow parent
$ ws { W.floating = oldFloating } $ ws { W.floating = oldFloating }
) )
windows
(\ws -> ws { W.floating = M.delete childWindow (W.floating ws) })
-- after restoring, we remove the information about the swallowing from the state. -- after restoring, we remove the information about the swallowing from the state.
XS.modify $ removeSwallowed childWindow XS.modify $ removeSwallowed childWindow
XS.modify $ setStackBeforeWindowClosing Nothing XS.modify $ setStackBeforeWindowClosing Nothing
@ -168,15 +161,15 @@ currentStack :: W.StackSet i l a sid sd -> Maybe (W.Stack a)
currentStack = W.stack . W.workspace . W.current currentStack = W.stack . W.workspace . W.current
-- | copy the floating related state of one window to another window in a StackSet. -- | move the floating state from one window to another, sinking the original window
copyFloatingState moveFloatingState
:: Ord a :: Ord a
=> a -- ^ window to copy from => a -- ^ window to move from
-> a -- ^ window to copy to -> a -- ^ window to move to
-> W.StackSet i l a s sd -> W.StackSet i l a s sd
-> W.StackSet i l a s sd -> W.StackSet i l a s sd
copyFloatingState from to ws = ws moveFloatingState from to ws = ws
{ W.floating = maybe (M.delete to (W.floating ws)) { W.floating = M.delete from $ maybe (M.delete to (W.floating ws))
(\r -> M.insert to r (W.floating ws)) (\r -> M.insert to r (W.floating ws))
(M.lookup from (W.floating ws)) (M.lookup from (W.floating ws))
} }

View file

@ -0,0 +1 @@
Progress 0/2 Progress 1/2: my-xmonad