mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
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:
@@ -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 },
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user