winit icon indicating copy to clipboard operation
winit copied to clipboard

If events follow an AboutToWait, must a NewEvents precede those events?

Open rukai opened this issue 1 year ago • 1 comments

I have an issue reported to winit_input_helper: https://github.com/rukai/winit_input_helper/issues/55 In this issue a user observes events occurring like:

event: NewEvents(Poll)
event: AboutToWait
event: WindowEvent { window_id: WindowId(WindowId(11996930)), event: CloseRequested }
event: WindowEvent { window_id: WindowId(WindowId(11996930)), event: Focused(true) }
event: NewEvents(Poll)
event: AboutToWait

My original reading of https://docs.rs/winit/latest/winit/event/enum.Event.html led me to believe that this was impossible and that a NewEvents must precede any new events after an AboutToWait. I can now see that whether or not this is the case is up for interpretation.

What I want from this issue is for this behavior to be documented either way:

  • If NewEvents must precede events after AboutToWait, then document that in https://docs.rs/winit/latest/winit/event/enum.Event.html
  • Otherwise if NewEvents does not need to precede events after AboutToWait, then document that in https://docs.rs/winit/latest/winit/event/enum.Event.html

rukai avatar Mar 04 '24 03:03 rukai

This looks like a bug to me. https://github.com/rukai/winit_input_helper/issues/55 doesn't seem to include any more information, so I will ask there.

EDIT: I didn't read carefully enough.

Clicking on "Close window" via the windows task bar is ignored in winit_input_helper.

I agree that the documentation could be improved on this front.

daxpedda avatar Mar 04 '24 08:03 daxpedda