-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Application ExitMode #1662
Merged
grokys
merged 12 commits into
AvaloniaUI:master
from
Gillibald:feature/ApplicationExitMode
Jun 29, 2018
Merged
Application ExitMode #1662
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e576ec1
Initial
Gillibald fca1026
Add ExitMode comments
Gillibald 5158993
Merge branch 'master' into feature/ApplicationExitMode
Gillibald 42dadae
Merge fix
Gillibald 7e8f9fb
Add NullArgumentException for Run with main window
Gillibald 0214939
Add unit test
Gillibald f1ab4a9
Merge branch 'master' into feature/ApplicationExitMode
Gillibald 90fdfae
Remove invoke call on Application.Run
Gillibald aa3a116
Merge branch 'master' into feature/ApplicationExitMode
Gillibald 178ca30
Merge branch 'feature/ApplicationExitMode' of https://github.com/Gill…
Gillibald 64f8928
Merge branch 'master' into feature/ApplicationExitMode
Gillibald ceef449
Merge branch 'master' into feature/ApplicationExitMode
grokys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) The Avalonia Project. All rights reserved. | ||
// Licensed under the MIT license. See licence.md file in the project root for full license information. | ||
|
||
namespace Avalonia | ||
{ | ||
public enum ExitMode | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add some XML documentation to this enum? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will add some comments |
||
{ | ||
OnLastWindowClose, | ||
OnMainWindowClose, | ||
OnExplicitExit | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be done via an invoke?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a better solution to show the main window and start up the main loop. The invoke queues the action for execution and gets executed when the main loop runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried changing this to:
And it seems to work. What am I missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If everything works its fine. Not sure about side effects. My solution only runs after the main loop is running. Maybe show does the same. At some point something has to be invoked on the main thread. Is it possible to call run on a different thread or even Window.Show? My solution would avoid that issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried what you did and it didn't work. My approach always runs. Don't know why yours work on your environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried it with Skia or Direct2D1? Yours works with Skia but not with Direct2D1 on my machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it with Win32/D2D but it also works with skia here. Strange that it doesn't work with D2D on your machine, I don't see how the rendering backend would affect whether a window gets shown or not - that should depend on the windowing backend.
It's also strange because this is how it works on
master
-Window.Show
is called fromAppBuilderBase.Start
before the main loop is started.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont understand it either has probably something to do with the. net runtime. With .Net Core I dont need invoke. Will remove the invoke call and just hope others don't have the problem.