Replace Closed event with CloseRequested and Destroyed#476
Merged
august64 merged 3 commits intorust-windowing:masterfrom Apr 24, 2018
Merged
Replace Closed event with CloseRequested and Destroyed#476august64 merged 3 commits intorust-windowing:masterfrom
august64 merged 3 commits intorust-windowing:masterfrom
Conversation
Implements rust-windowing#434 The existing Closed event had ambiguous meaning, both in name and in cross-platform behavior. Closed is now split into two more precise events: * CloseRequested - the window has been requested to close, most commonly by having clicked the window's close button. Whether or not you respond by closing the window is up to you. * Destroyed - the window has been destroyed, and can no longer be safely used. Most notably, now you can reliably implement classic patterns like prompting the user to save their work before closing, and have the opportunity to perform any necessary cleanup. Migrating to the new API is straightforward. In most cases, you can simply replace all existing usages of Closed with CloseRequested. For more information, see the example programs, particularly handling_close and multiwindow. iOS applications must replace all usages of Closed with Destroyed, and require no other changes.
This was referenced Apr 20, 2018
Contributor
|
LGTM for the wayland part. |
Xaeroxe
approved these changes
Apr 20, 2018
Contributor
Xaeroxe
left a comment
There was a problem hiding this comment.
Windows code LGTM. Thanks! This looks a lot more stable.
This was referenced Apr 21, 2018
Merged
This was referenced Apr 28, 2018
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves #434
This is implemented and tested on Windows, macOS, X11, and Wayland.
Migrating to the new events is easy, since most people just need to replace all of their
ClosedwithCloseRequested.