summaryrefslogtreecommitdiff
path: root/lib/WindowState.hs
blob: 3f7d4fb703fee0ae271701cdccaa68b0a6fda658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module WindowState (toggleFloat) where

import XMonad

import qualified Data.Map as Map
import qualified XMonad.StackSet as W

toggleFloat :: Window -> X ()
toggleFloat w = windows $ \windowSet ->
  if Map.member w $ W.floating windowSet
    then W.sink w windowSet
    else W.float w floatingWindowRect windowSet
  where
    floatingWindowRect = W.RationalRect (1 / 3) (1 / 6) (1 / 2) (4 / 5)