Skip to content
New issue

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

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

Already on GitHub? # to your account

Trigger the CloseRequested event on every attempt to close the application #1941

Open
2 tasks done
Digitalone1 opened this issue Jul 4, 2023 · 4 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@Digitalone1
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

As pointed out in #195 and GyulyVGC/sniffnet#291 the CloseRequested is not triggered when:

  • ctrl+c is typed from the command line
  • cmd+q is 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.
@Digitalone1 Digitalone1 added the bug Something isn't working label Jul 4, 2023
@hecrj
Copy link
Member

hecrj commented Jul 10, 2023

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.

@GyulyVGC
Copy link
Contributor

I can confirm that winit is not producing a CloseRequested event when pressing Cmd+Q on 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.

@GyulyVGC
Copy link
Contributor

GyulyVGC commented Dec 1, 2023

I can confirm that winit is not producing a CloseRequested event when pressing Cmd+Q on 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

@abique
Copy link

abique commented Jun 23, 2024

Reference some related issues:
rust-windowing/winit#1992
rust-windowing/winit#2776

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants