Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

On Web, use the new WebCanvasWindowHandle #3270

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

daxpedda
Copy link
Member

Now we don't have to set data-raw-handle on the canvas anymore.

@daxpedda
Copy link
Member Author

Unfortunately WebCanvasWindowHandle is supposed to be !Send, for good reasons. Currently asking in IRC how other platforms are doing this.

@daxpedda daxpedda requested a review from madsmtm as a code owner December 17, 2023 21:34
@daxpedda
Copy link
Member Author

So I went ahead and made Window::window_handle() return HandleError::Unavailable when not on the main thread. To do this I had to change the call to raw_window_handle_rwh_06() from Window because it was using maybe_wait_on_main().

@madsmtm I didn't actually change anything in MacOS/iOS behavior because it still calls maybe_wait_on_main() with the SendSyncWrapper there, but maybe you want to change that to return HandleError::Unavailable as well?

@madsmtm
Copy link
Member

madsmtm commented Dec 22, 2023

maybe you want to change that to return HandleError::Unavailable as well?

Sure, see #3288.

@daxpedda
Copy link
Member Author

Alright, let me go ahead and merge this then.

@madsmtm
Copy link
Member

madsmtm commented Dec 22, 2023

But returning WebCanvasWindowHandle instead of WebWindowHandle, while it shouldn't be a breaking change, in practice it will be, since a lot of users will assume that it returns WebWindowHandle, and panic if it doesn't.

So I think you should update the changelog to reflect that.

@daxpedda
Copy link
Member Author

But returning WebCanvasWindowHandle instead of WebWindowHandle, while it shouldn't be a breaking change, in practice it will be, since a lot of users will assume that it returns WebWindowHandle, and panic if it doesn't.

Hm, alright.

@daxpedda daxpedda merged commit 8cd3aaa into rust-windowing:master Dec 22, 2023
50 checks passed
hecrj pushed a commit to iced-rs/winit that referenced this pull request Mar 19, 2024
hecrj pushed a commit to iced-rs/winit that referenced this pull request Mar 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants