-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for events when the application terminates #170
Comments
This sounds like a
That's one way to approach it. However, closing applications gracefully is sometimes more complicated than that. Users may need to run commands and wait until completion, for instance. Because of this, I think it's a good idea to differentiate between a close request and the application deciding it should exit. We could add a new event Sounds good? |
Sorry for not being able to tell you exactly what happened.
I think it is very good.
|
I hit this today, and am wondering if your suggestion is sufficiently non-controversial for me to implement. Specifically:
Which I interpret as:
|
The CloseRequested event doesn't seem to let me interrupt the window closing for me, on PopOS (Linux). I'm able to act on other window events, so I know I've got the basic event subscription and update loop set up correctly. But no event is triggered at all for me when I click the window's close button in the title bar. (I'm using Iced and Rust for the first time, so apologies if I'm just missing something obvious. Unable to test on another OS at the moment.) |
@zenzoa you need to set the window settings properly |
@13r0ck Ah! Thank you! |
In case anyone is wondering why this isn't working anymore in 0.7.0, check out commit b5ab50b and do this to fix: First, remove your
(#1606 says to return Hope this helps. |
@sowbug That works. But it's probably a better idea to return |
I see. I tried again and came up with this:
As usual, there's something unique and mysterious about my code that prevented the compiler from inferring the Message type. Apparently I had imported |
Thanks @hecrj for advice in iced-rs/iced#170
When I close the window on MacOS,
Since the current version of
winit::event_loop
seems to be causing a panic without returning control flow,Drop traits for variables allocated by the my application are not executed.
I want something like this,
Is it better to cast a window event and handle it immediately?
The text was updated successfully, but these errors were encountered: