diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-09-27 21:55:34 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-09-27 21:55:34 +0200 |
commit | acc2e8b70b473d0ea336b09937fe4255cc429e40 (patch) | |
tree | f6ae27f78fd772c5b2009eaa48cddad25798b74f | |
parent | bc18cae746b38dcb31b39f46b20a3a6bdd727206 (diff) | |
download | metatile-acc2e8b70b473d0ea336b09937fe4255cc429e40.tar metatile-acc2e8b70b473d0ea336b09937fe4255cc429e40.zip |
Refactor floating code in manage
darcs-hash:20070927195534-a5988-974ab4268e9401a5469d0293d1d033d37b8cedde
-rw-r--r-- | Operations.hs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Operations.hs b/Operations.hs index 2a0559f..128c4ad 100644 --- a/Operations.hs +++ b/Operations.hs @@ -49,17 +49,16 @@ manage :: Window -> X () manage w = whenX (fmap not $ isClient w) $ withDisplay $ \d -> do setInitialProperties w - -- FIXME: This is pretty awkward. We can't can't let "refresh" happen - -- before the call to float, because that will resize the window and - -- lose the default sizing. - sh <- io $ getWMNormalHints d w + let isFixedSize = sh_min_size sh /= Nothing && sh_min_size sh == sh_max_size sh isTransient <- isJust `liftM` io (getTransientForHint d w) - if isFixedSize || isTransient - then do modify $ \s -> s { windowset = W.insertUp w (windowset s) } - float w -- \^^ now go the refresh. - else windows $ W.insertUp w + + (sc, rr) <- floatLocation w + let f ws | isFixedSize || isTransient = W.float w rr . W.insertUp w . W.view i $ ws + | otherwise = W.insertUp w ws + where i = fromMaybe (W.tag . W.workspace . W.current $ ws) $ W.lookupWorkspace sc ws + windows f -- | unmanage. A window no longer exists, remove it from the window -- list, on whatever workspace it is. |