Closed n1essa closed 2 years ago
I'm fine with moving it somewhere else. I put it in Extras.hsc
because that's where the related function getWMNormalHints
is.
Yeh, as I said, that's historical. This might not be the PR to start moving things around, though; I'm more interested in the other maintainers' opinions.
I'm not entirely sure if moving things around is a good use of anyone's time at this point of X11 developmentā¦ Anyway, this PR adds it exactly where I'd expect it now, so until someone figures out how things should be (and again I don't think that's a pressing issue at this point), I'd just just leave it here.
With this change to using XAllocSizeHints
, I followed the pattern I saw elsewhere, but I'm wondering if we also need to handle XAllocSizeHints
returning null
Technically yes, but if it returns NULL
we'll find out soon enough anyway because everything else will fail too. :) Still, probably best to compare the Ptr
against nullPtr
(this may require a castPtr
).
BTW, as it does an allocation it should really be safe
instead of unsafe
. (unsafe
should only be used for X11 macros; pretty much everything else is potentially unsafe and should be properly protected by making a safe
call.)
Is this looking reasonable?
Yes, this looks reasonable.
Do we really want this to go into
Extras.hsc
? If anything, I'd think it was time to start merging stuff where it belongs and making it a file of backward compatibility reexports. (Historically it was its own package, adding stuff we needed on top of the original X11 package.)