summaryrefslogtreecommitdiffstats
path: root/XMonad/Operations.hs
diff options
context:
space:
mode:
Diffstat (limited to 'XMonad/Operations.hs')
-rw-r--r--XMonad/Operations.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/XMonad/Operations.hs b/XMonad/Operations.hs
index 4a3e3fc..79feba1 100644
--- a/XMonad/Operations.hs
+++ b/XMonad/Operations.hs
@@ -27,7 +27,6 @@ import Data.List (nub, (\\), find)
import Data.Bits ((.|.), (.&.), complement, testBit)
import Data.Ratio
import qualified Data.Map as M
-import qualified Data.Set as S
import Control.Applicative
import Control.Monad.Reader
@@ -158,7 +157,7 @@ setWMState w v = withDisplay $ \dpy -> do
-- | hide. Hide a window by unmapping it, and setting Iconified.
hide :: Window -> X ()
-hide w = whenX (gets (S.member w . mapped)) $ withDisplay $ \d -> do
+hide w = whenX (getsWindowState wsMapped w) $ withDisplay $ \d -> do
cMask <- asks $ clientMask . config
io $ do selectInput d w (cMask .&. complement structureNotifyMask)
unmapWindow d w
@@ -166,8 +165,8 @@ hide w = whenX (gets (S.member w . mapped)) $ withDisplay $ \d -> do
setWMState w iconicState
-- this part is key: we increment the waitingUnmap counter to distinguish
-- between client and xmonad initiated unmaps.
- modify (\s -> s { waitingUnmap = M.insertWith (+) w 1 (waitingUnmap s)
- , mapped = S.delete w (mapped s) })
+ modifyWindowState (\ws -> ws { wsMapped = False
+ , wsWaitingUnmap = (wsWaitingUnmap ws) + 1 }) w
-- | reveal. Show a window by mapping it and setting Normal
-- this is harmless if the window was already visible
@@ -175,7 +174,7 @@ reveal :: Window -> X ()
reveal w = withDisplay $ \d -> do
setWMState w normalState
io $ mapWindow d w
- whenX (isClient w) $ modify (\s -> s { mapped = S.insert w (mapped s) })
+ whenX (isClient w) $ modifyWindowState (\ws -> ws { wsMapped = True }) w
-- | Set some properties when we initially gain control of a window
setInitialProperties :: Window -> X ()