alaingalvan / CrossWindow

💻📱 A cross platform system abstraction library written in C++ for managing windows and performing OS tasks.
https://alain.xyz/libraries/crosswindow
MIT License
632 stars 50 forks source link

Mac: Added missing close, focus and resize events #33

Open rthrfrd opened 2 months ago

rthrfrd commented 2 months ago

Thanks for the work to create this! Unfortunately it wouldn't fit my needs without some of these key events on Mac, so I've done my best to add them!

I added an NSWindowDelegate to the NSWindow to get more information about what's happening with the window (looking at the NSWindowDelegate API, there's more that can now be done here I'm sure). It emits NSEvents of type ApplicationDefined (as recommended by docs) back to the NSApplication to be picked up in your existing EventQueue.

I don't have much Objective-C experience so apologies in advance! I've tried to mirror the existing implementation/style as much as possible.

alaingalvan commented 2 months ago

Thanks Alex, this looks great, I'll go ahead and test it out on my end and merge it in after. 😁