iced icon indicating copy to clipboard operation
iced copied to clipboard

Trigger the CloseRequested event on every attempt to close the application

Open Digitalone1 opened this issue 2 years ago • 4 comments
trafficstars

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+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 avatar Jul 04 '23 08:07 Digitalone1

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.

hecrj avatar Jul 10 '23 19:07 hecrj

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 avatar Aug 30 '23 15:08 GyulyVGC

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

GyulyVGC avatar Dec 01 '23 08:12 GyulyVGC

Reference some related issues: https://github.com/rust-windowing/winit/issues/1992 https://github.com/rust-windowing/winit/issues/2776

abique avatar Jun 23 '24 11:06 abique