diff --git a/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/SetMasterNTall.hs b/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/SetMasterNTall.hs index a08f7742..a09af1d3 100644 --- a/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/SetMasterNTall.hs +++ b/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/SetMasterNTall.hs @@ -23,8 +23,10 @@ instance LayoutClass SetMasterNTall a where let ws' = W.Workspace t (unSetMasterNTall l) s in (fmap . fmap . fmap) SetMasterNTall . runLayout ws' - handleMessage (SetMasterNTall l@(ResizableTall _n0 d f s)) mess - | Just (SetMasterN n) <- fromMessage mess = pure $ Just $ SetMasterNTall $ ResizableTall n d f s + handleMessage (SetMasterNTall l@(ResizableTall n0 d f s)) mess + | Just (SetMasterN n) <- fromMessage mess = pure $ + if n0 /= n then Just $ SetMasterNTall $ ResizableTall n d f s + else Nothing | otherwise = (fmap . fmap) SetMasterNTall . handleMessage l $ mess description (SetMasterNTall l) = description l diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index e5c8ad57..3a57cc1e 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -210,10 +210,10 @@ setMasterNEventHandleHook ev = let adjustMasterCount :: X () adjustMasterCount = do count <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset - if count <= 3 then sendMessage (SetMasterN 1) - else if count <= 5 then sendMessage (SetMasterN 2) - else if count <= 7 then sendMessage (SetMasterN 3) - else pure () + if count >= 7 then sendMessage (SetMasterN 4) + else if count >= 5 then sendMessage (SetMasterN 3) + else if count >= 3 then sendMessage (SetMasterN 2) + else sendMessage (SetMasterN 1) in do case ev of MapRequestEvent{} -> adjustMasterCount