mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-16 12:33:47 -07:00
Fixed a crash due to an unhandled getWindowAttributes exception
This commit is contained in:
@@ -632,8 +632,12 @@ type D = (Dimension, Dimension)
|
|||||||
mkAdjust :: Window -> X (D -> D)
|
mkAdjust :: Window -> X (D -> D)
|
||||||
mkAdjust w = withDisplay $ \d -> liftIO $ do
|
mkAdjust w = withDisplay $ \d -> liftIO $ do
|
||||||
sh <- getWMNormalHints d w
|
sh <- getWMNormalHints d w
|
||||||
bw <- fmap (fromIntegral . wa_border_width) $ getWindowAttributes d w
|
wa <- C.try $ getWindowAttributes d w
|
||||||
return $ applySizeHints bw sh
|
case wa of
|
||||||
|
Left err -> const (return id) (err :: C.SomeException)
|
||||||
|
Right wa' ->
|
||||||
|
let bw = fromIntegral $ wa_border_width wa'
|
||||||
|
in return $ applySizeHints bw sh
|
||||||
|
|
||||||
-- | Reduce the dimensions if needed to comply to the given SizeHints, taking
|
-- | Reduce the dimensions if needed to comply to the given SizeHints, taking
|
||||||
-- window borders into account.
|
-- window borders into account.
|
||||||
|
Reference in New Issue
Block a user