pixels icon indicating copy to clipboard operation
pixels copied to clipboard

winit 0.27 upgrade breaking changes

Open Zageron opened this issue 3 years ago • 3 comments

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 avatar Jul 29 '22 16:07 Zageron

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.

Zageron avatar Jul 29 '22 16:07 Zageron

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

https://github.com/parasyte/pixels/blob/41063dbf4b105c45c7bb560f63b41459957faa85/Cargo.toml#L23

parasyte avatar Jul 29 '22 18:07 parasyte

Just looked into this. We are blocked on https://github.com/gfx-rs/wgpu/pull/2918 and #289

parasyte avatar Jul 29 '22 18:07 parasyte

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.

parasyte avatar Aug 18 '22 04:08 parasyte

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

Zageron avatar Aug 19 '22 20:08 Zageron