macos: Map our user generated event to Event::Awakened
This fixes propagation of Event::Awakend from wakeup_event_loop() when
using poll_event() on macOS.
Currently wait_event() translates all unknown events into
Event::Awakened so doesn't need the explicit translation.
@@ -822,6 +822,12 @@ unsafe fn NSEventToEvent(window: &Window, nsevent: id) -> Option<Event> {
appkit::NSEventTypePressure => {
Some(Event::TouchpadPressure(nsevent.pressure(), nsevent.stage()))
},
+ appkit::NSApplicationDefined => {
+ match nsevent.subtype() {
+ appkit::NSEventSubtype::NSApplicationActivatedEventType => { Some(Event::Awakened) }
+ _ => { None }
+ }
+ },
_ => { None },
}
}
