xmonad-contrib
xmonad-contrib copied to clipboard
X.L.SimplestFloat contains an unsafe `getWindowAttributes`
getSize :: Rectangle -> Window -> X (Window,Rectangle)
getSize (Rectangle rx ry _ _) w = do
d <- asks display
bw <- asks (borderWidth . config)
wa <- io $ getWindowAttributes d w
let x = max rx $ fi $ wa_x wa
y = max ry $ fi $ wa_y wa
wh = fi (wa_width wa) + (bw * 2)
ht = fi (wa_height wa) + (bw * 2)
return (w, Rectangle x y wh ht)
I guess nobody actually uses this layout, or we'd have heard about layouts suddenly becoming Full because they'd thrown exceptions by now.
Or getWindowAttributes never fails :)
Pretty sure it does, and that's why safeGetWindowAttributes is in Prelude.hs. (I have certainly seen apps create and withdraw windows before we can manage them,)