mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11: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:
parent
09e6698236
commit
3b1fdc0f55
|
@ -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 },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue