Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloseRequested from windows task bar is not propagated #55

Open
Azkellas opened this issue Jan 31, 2024 · 1 comment
Open

CloseRequested from windows task bar is not propagated #55

Azkellas opened this issue Jan 31, 2024 · 1 comment

Comments

@Azkellas
Copy link
Contributor

Clicking on "Close window" via the windows task bar is ignored in winit_input_helper.
The CloseRequested event is sent between two steps, after an AboutToWait and before a NewEvents(_), so when the NewEvents(_) arrives, the step begins and reset WinitInputHelper::close_requested to false.

With ControlFlow::Poll:

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

Without ControlFlow::Poll:

event: AboutToWait
event: NewEvents(WaitCancelled { start: Instant { t: 1776733.8859361s }, requested_resume: None })
event: AboutToWait
event: WindowEvent { window_id: WindowId(WindowId(340828)), event: Focused(true) }
event: WindowEvent { window_id: WindowId(WindowId(340828)), event: CloseRequested }
event: NewEvents(WaitCancelled { start: Instant { t: 1776734.1857145s }, requested_resume: None })
event: AboutToWait
@rukai
Copy link
Owner

rukai commented Mar 4, 2024

Thankyou for the thorough investigation!
Its not clear to me if winit is breaking its contract by returning events between an AboutToWait and a NewEvent, I'll raise an issue on their repo to get it clarified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants