haskell-game / sdl2

Haskell bindings to the SDL2 library
Other
363 stars 87 forks source link

Add binding for getWindowBordersSize #231

Closed TristanCacqueray closed 2 years ago

TristanCacqueray commented 3 years ago

This change enables more accurate window position management by taking into account the display server decoration.

TristanCacqueray commented 3 years ago

The function may fail, should the binding do something in that case?

ocharles commented 2 years ago

The function may fail, should the binding do something in that case?

I think we should return a Maybe here. Or possible Either String if we want to automatically call SDL_GetError? Unfortunately I can't quite remember what our error handling policy is - it might be good to check what other functions are doing.

TristanCacqueray commented 2 years ago

Oh right, it seems like the other functions are returning a Maybe, and I've updated the PR to do the same. Thanks for the feedback!