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

Canceling the closing event is not working #7393

Closed
os-lmo opened this issue Jan 19, 2022 · 3 comments · Fixed by #7400
Closed

Canceling the closing event is not working #7393

os-lmo opened this issue Jan 19, 2022 · 3 comments · Fixed by #7400
Labels
by-design The behavior reported in the issue is actually correct.

Comments

@os-lmo
Copy link

os-lmo commented Jan 19, 2022

Describe the bug
If we enable the Cancel arg in the Closing event, Avalonia is ignoring it and the application closes.
It only happens in 0.10.999-cibuild0017786-beta version

To Reproduce
Steps to reproduce the behavior:

  1. In MacOS, build the demo available here
  2. Open the demo
  3. Go to the native menu and choose "Quit" (or Cmd + Q)
  4. The application closes, and it shouldn't

Expected behavior
The application should not close, since we are explicitly canceling the close.

Screenshots
We are canceling the close event but it seems not having effect
image

Desktop (please complete the following information):

@os-lmo os-lmo added the bug label Jan 19, 2022
@maxkatz6 maxkatz6 added by-design The behavior reported in the issue is actually correct. and removed bug labels Jan 19, 2022
@maxkatz6
Copy link
Member

Window is not closing, but whole app is shutting down. It's a special behavior of macos, which doesn't even tried to close windows at this point.
If you need to cancel app shutting down - there is ShutdownRequested event.
Although as I see from other ticket, there is a problem too #7389

@heldergoncalves92
Copy link

heldergoncalves92 commented Jan 20, 2022

Is this a new behavior that changed on purpose? Since versions equal and below 0.10.11 do not have that behavior, and allowed to cancel closing at this point.

@maxkatz6
Copy link
Member

Seems like I was wrong, and now we manually call Close on all windows, when shutdown is requested.
So only #7400 issue was left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
by-design The behavior reported in the issue is actually correct.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants