[xmonad] Issue 414 in xmonad: Wrong floating window sizes on multimon setup

codesite-noreply at google.com codesite-noreply at google.com
Tue Nov 25 06:39:31 UTC 2014


Comment #6 on issue 414 by ezy... at mit.edu: Wrong floating window sizes on  
multimon setup
https://code.google.com/p/xmonad/issues/detail?id=414

This chunk of code in XMonad.Operations is the buggy code:

-- ---------------------------------------------------------------------
-- |
-- Window manager operations
-- manage. Add a new window to be managed in the current workspace.
-- Bring it into focus.
--
-- Whether the window is already managed, or not, it is mapped, has its
-- border set, and its event mask set.
--
manage :: Window -> X ()
manage w = whenX (not <$> isClient w) $ withDisplay $ \d -> do
     sh <- io $ getWMNormalHints d w

     let isFixedSize = sh_min_size sh /= Nothing && sh_min_size sh ==  
sh_max_size sh
     isTransient <- isJust <$> io (getTransientForHint d w)

     rr <- snd `fmap` floatLocation w
     -- ensure that float windows don't go over the edge of the screen
     let adjust (W.RationalRect x y wid h) | x + wid > 1 || y + h > 1 || x <  
0 || y < 0
                                               = W.RationalRect (0.5 -  
wid/2) (0.5 - h/2) wid h
         adjust r = r

         f ws | isFixedSize || isTransient = W.float w (adjust rr) .  
W.insertUp w . W.view i $ ws
              | otherwise                  = W.insertUp w ws
             where i = W.tag $ W.workspace $ W.current ws

     mh <- asks (manageHook . config)
     g <- appEndo <$> userCodeDef (Endo id) (runQuery mh w)
     windows (g . f)

Notice the floatLocation query throws out the recommended screen for the  
float to be placed on.

I don't actually know what the right version of this code is.

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings


More information about the xmonad mailing list