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

winit 0.27 upgrade breaking changes #292

Closed
Zageron opened this issue Jul 29, 2022 · 5 comments · Fixed by #302
Closed

winit 0.27 upgrade breaking changes #292

Zageron opened this issue Jul 29, 2022 · 5 comments · Fixed by #302
Labels
enhancement New feature or request

Comments

@Zageron
Copy link
Contributor

Zageron commented Jul 29, 2022

error[E0277]: the trait bound `winit::window::Window: HasRawWindowHandle` is not satisfied
   --> crates\head\src\main.rs:350:27
    |
350 |     let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, &window);
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasRawWindowHandle` is not implemented for `winit::window::Window`
    |
    = help: the trait `HasRawWindowHandle` is implemented for `&'a T`

error[E0277]: the trait bound `winit::window::Window: HasRawWindowHandle` is not satisfied
   --> crates\head\src\main.rs:351:71
    |
351 |     let pixels = if let Ok(pixels) = Pixels::new_async(WIDTH, HEIGHT, surface_texture).await {
    |                                      -----------------                ^^^^^^^^^^^^^^^ the trait `HasRawWindowHandle` is not implemented for `winit::window::Window`
    |                                      |
    |                                      required by a bound introduced by this call
    |
    = help: the trait `HasRawWindowHandle` is implemented for `&'a T`

note: required by a bound in `pixels::Pixels::new_async`
   --> C:\Users\Zageron\.cargo\git\checkouts\pixels-fd3805be475df9df\0b15a5d\src\lib.rs:227:31
    |
227 |     pub async fn new_async<W: HasRawWindowHandle>(
    |                               ^^^^^^^^^^^^^^^^^^ required by this bound in `pixels::Pixels::new_async`

Thanks!

@Zageron
Copy link
Contributor Author

Zageron commented Jul 29, 2022

I am interested in seeing how this is resolved, not understanding how to make a PR for this feels like a major gap in my knowledge.

@parasyte parasyte added the enhancement New feature or request label Jul 29, 2022
@parasyte
Copy link
Owner

We depend on raw-window-handle which is a shared dependency with winit, and needs to be updated to maintain compatibility with newer versions.

raw-window-handle = "0.4"

@parasyte
Copy link
Owner

Just looked into this. We are blocked on gfx-rs/wgpu#2918 and #289

parasyte added a commit that referenced this issue Aug 18, 2022
Closes #292

TODO examples:

- [x] `conway`
- [x] `custom-shader`
- [ ] `imgui-winit`
    - TBD: `imgui-winit-support` needs to be updated. See: imgui-rs/imgui-rs#659
    - TBD: `imgui-wgpu` needs to be updated (No PR yet)
- [ ] `invaders`
    - TBD: `game-loop` needs to be updated. (No PR yet)
- [x] `minimal-egui`
- [x] `minimal-web`
- [x] `minimal-winit`
- [x] `raqote-winit`
parasyte added a commit that referenced this issue Aug 18, 2022
Closes #292

TODO examples:

- [x] `conway`
- [x] `custom-shader`
- [ ] `imgui-winit`
    - TBD: `imgui-winit-support` needs to be updated. See: imgui-rs/imgui-rs#659
    - TBD: `imgui-wgpu` needs to be updated (No PR yet)
- [ ] `invaders`
    - TBD: `game-loop` needs to be updated. (No PR yet)
- [x] `minimal-egui`
- [x] `minimal-web`
- [x] `minimal-winit`
- [x] `raqote-winit`
@parasyte parasyte mentioned this issue Aug 18, 2022
8 tasks
@parasyte
Copy link
Owner

parasyte commented Aug 18, 2022

Heads up! This is getting addressed by #302.

winit 0.27.2 is backward compatible with raw-window-handle 0.4, so you should be able to easily update your project since #300 landed.

@Zageron
Copy link
Contributor Author

Zageron commented Aug 19, 2022

Yup everything working great for me with latest on your repo.

@Zageron Zageron closed this as completed Aug 19, 2022
parasyte added a commit that referenced this issue Oct 1, 2022
* Update winit 0.27

Closes #292

This _does not_ update `winit` in the `imgui-winit` example. See #302 (comment) for discussion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants