iced
iced copied to clipboard
Trigger the CloseRequested event on every attempt to close the application
Is there an existing issue for this?
- [X] I have searched the existing issues.
Is this issue related to iced?
- [X] My hardware is compatible and my graphics drivers are up-to-date.
What happened?
As pointed out in #195 and https://github.com/GyulyVGC/sniffnet/issues/291 the CloseRequested is not triggered when:
ctrl+cis typed from the command linecmd+qis typed on MacOS
You are discussing there, but maybe it's better to make a dedicated issue.
What is the expected behavior?
Trigger the CloseRequested event, not only on the two points listed above, but on every attempt to close the application.
Version
master
Operating System
Linux
Do you have any log output?
No output needed.
Ctrl+C in a terminal is a global process interrupt and should be handled by you.
I can confirm that winit is not producing a CloseRequested event when pressing Cmd+Q on macOS. We should report that there.
I can confirm that
winitis not producing aCloseRequestedevent when pressingCmd+Qon macOS. We should report that there.
I don't know if it can be of any help, but I noticed that Cmd+Q doesn't even let Application::run correctly return from the invocation.
I can confirm that
winitis not producing aCloseRequestedevent when pressingCmd+Qon macOS. We should report that there.
This is a pretty important feature for my app since several configurations must be saved before exiting. At the same time I don't want to put pressure on you to solve this in the short term, but I was wondering if you could give me some hints that can help me fix it @hecrj
Reference some related issues: https://github.com/rust-windowing/winit/issues/1992 https://github.com/rust-windowing/winit/issues/2776