baseview
baseview copied to clipboard
add support for Window::Focused/Unfocused events on macOS
trigger WindowEvent::Focused and WindowEvent::Unfocused events when the plugin window gains/loses focus. implemented by adding observers to NSNotificationCenter::defaultCenter() that listen to NSWindowDidBecomeKeyNotification and NSWindowDidResignKeyNotification notifications on the NSViews' window.
tested and confirmed to work in Live, Bitwig, FL Studio, Reaper and AudioPluginHost.
there was a slight oversight where the focus events were not sent correctly if the window contained other things besides just the NSView that houses the plugin. should be fixed now though, also added some comments for clarity.