Gate non-wasm32 winit features behind flags.#1178
Closed
TannerRogalsky wants to merge 1 commit into
Closed
Conversation
e6ab610 to
8b0f2e6
Compare
Member
|
I am guessing most of these will be fixed by hecrj/window_clipboard#18 once it is merged and released. I think it'd be great to offer an |
Contributor
Author
|
I can certainly appreciate that. I find that the way that winit implements the "does not return" event loop via an uncaught exception to be not acceptable for my use cases. But providing that option to users would be absolutely an improvement. I'll leave this open for reference and/or discussion. Feel free to close as you see fit and thanks for the consideration! |
Member
|
Closing since this should be addressed by hecrj/window_clipboard#18 and #1096. |
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.
Let me state, up front, that I would not be upset if this PR were declined. I recognize that it makes some decisions that I did not consult anyone on.
Motivation: these changes (along with #1117 and #1118) allow the winit "native" shell to compile and run on the
wasm32-unknown-unknowntarget. This presents a homogeneous and, IMO, very pleasant development target for native/web cross-platform Iced GUIs.It requires that a custom event loop is run on wasm32 platforms. Personally, I think that that is acceptable. Winit's basic event loop does work on
wasm32-unknown-unknownbut it is not particularly pretty andEventLoopExtRunReturnis not implemented (on which Iced currently depends) is not implemented. I'm of the opinion that this is fine: the requirement that users implement their own event loop on web seems like a reasonable tradeoff for using a native shell on a platform that is not really native.It does not introduce any changes to existing users of the crate on non wasm platforms.