The API for NSWindow's creation has a contentRect parameter,
but it seems to be handled like a frameRect. So convert from
contentRect to frameRect first. Without this change the
top 20-ish lines of the image are under the title bar.
It wasn't detecting that the window was closed when I closed it by
clicking the red X button. As a result, the window would close, but
mfb_update() didn't return -1, so the program kept running.
This was fixed by listening to the willClose event and using it to set a
flag. I'm not sure if this is the best way to do it, I really know
nothing about OSX/Cocoa.
Also, I fixed a few unused varible warnings. And warnings related to
NSUInteger not matching the expected signature with NSWindowStyleMask.
* x11: need to return somethin from processEvents()
* Added wayland support
* Documented how to use wayland support
* wayland: re-attach the buffer to actually trigger an update
* wayland: use the seat_listener
bmiColors is a C style flexible array with a default value of 1, so the bmiColors[1] and bmiColors[2] were accessing memory out of bounds and causing very weird stuff to happen. Fixed by doing the appropriate flexible buffer allocation.