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.
This commit is contained in:
Jeff Muizelaar 2017-01-16 14:35:34 -05:00
parent 09e6698236
commit 3b1fdc0f55

View file

@ -822,6 +822,12 @@ unsafe fn NSEventToEvent(window: &Window, nsevent: id) -> Option<Event> {
appkit::NSEventTypePressure => { appkit::NSEventTypePressure => {
Some(Event::TouchpadPressure(nsevent.pressure(), nsevent.stage())) Some(Event::TouchpadPressure(nsevent.pressure(), nsevent.stage()))
}, },
appkit::NSApplicationDefined => {
match nsevent.subtype() {
appkit::NSEventSubtype::NSApplicationActivatedEventType => { Some(Event::Awakened) }
_ => { None }
}
},
_ => { None }, _ => { None },
} }
} }