mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:29:40 +00:00
vanadium/xmonad: remove floating window from the count
This commit is contained in:
parent
040afef280
commit
088c6b31a5
1 changed files with 12 additions and 2 deletions
|
|
@ -33,9 +33,9 @@ import XMonad.Util.NamedScratchpad
|
|||
import XMonad.Util.SpawnOnce
|
||||
|
||||
import Data.Char.Greek
|
||||
import qualified Data.Map.Strict as M
|
||||
import Data.Ratio
|
||||
import Data.Semigroup
|
||||
import qualified Data.Map.Strict as M
|
||||
import System.Posix
|
||||
import Graphics.X11.ExtraTypes.XF86
|
||||
|
||||
|
|
@ -209,7 +209,17 @@ setMasterNEventHandleHook :: Event -> X All
|
|||
setMasterNEventHandleHook ev =
|
||||
let adjustMasterCount :: X ()
|
||||
adjustMasterCount = do
|
||||
count <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset
|
||||
ws <- gets windowset
|
||||
-- Remove the floating windows in the count
|
||||
let s :: Maybe (W.Stack Window)
|
||||
s = W.stack $ W.workspace $ W.current ws
|
||||
|
||||
count :: Int
|
||||
count =
|
||||
length
|
||||
$ filter (flip M.notMember (W.floating ws))
|
||||
$ W.integrate' s
|
||||
|
||||
if count >= 7 then sendMessage (SetMasterN 4)
|
||||
else if count >= 5 then sendMessage (SetMasterN 3)
|
||||
else if count >= 3 then sendMessage (SetMasterN 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue