I suppose the question that this error is asking you is: when `getWindowAttributes` throws an error, how should `floatLocation` respond?

Perhaps returning some default -- like `(0, RationalRect 0 0 1 1)` or something -- will be sufficient? I don't know how `floatLocation` gets used, so I don't know how dangerous a default that would be.

Do we need to change the type of `floatLocation` to admit that it may not know the right answer?

~d

On Sat, Sep 10, 2016 at 3:09 PM, Adam Sjøgren <asjo@koldfront.dk> wrote:
Daniel writes:

> The simplest thing will be to wrap just the call to `getWindowAttributes`,
> if that's the one you expect to fail.

It is one I observe failing, yes.

> It is not conveniently possible to wrap `X` actions; so instead,
> something like
>
>     withDisplay $ \d -> do
>       ws <- gets windowset
>       ewa <- io $ try (getWindowAttributes d w)
>       case ewa of
>           Left e -> io (putStrLn "HELP! do something!")
>           Right wa -> do
>               let bw = (fromIntegral . wa_border_width) wa
>               {- ... etc. -}

I can't make this construction compile, when I try to change
floatLocation to use it, I get errors about a return value being of type
X () instead of X (ScreenId, W.RationalRect).


  Best regards,

    Adam

--
 "Alla för alla, en för en                                    Adam Sjøgren
  Alla för alla, en för en                               asjo@koldfront.dk
  Så börjar vi om igen"

_______________________________________________
xmonad mailing list
xmonad@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad