Skip to content

Bump raw-window-handle = "0.6.2"? #193

Closed

Description

@GaussianWonder

Is an update to raw-window-handle possible?

It would allow integration with parented webview windows via wry >=v0.36.0.

The latest I can push in this direction currently is 0.35.2, at that stage wry still accepts HasRawWindowHandle trait.

I notice that keeping support for HasRawWindowHandle in newer versions requires some work, mainly:

raw_window_handle returns Result:

window.rs

unsafe impl<'a> HasRawWindowHandle for Window<'a> {
    fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError> {
        self.window.raw_window_handle()
    }
}

---WindowHandle accepts NonZero isize:

win/window.rs

unsafe impl HasRawWindowHandle for WindowHandle {
    fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError> {
        self.hwnd
            .ok_or(HandleError::Unavailable)
            .and_then(|hwnd| NonZeroIsize::new(hwnd as isize).ok_or(HandleError::Unavailable))
            .map(|hwnd| RawWindowHandle::Win32(Win32WindowHandle::new(hwnd)))
    }
}

This is where it occurred to me that these changes might not simply be a change of internal types, it can affect library to library operations, and it can unveil some hidden complexity I might not be aware of.

I am willing to continue working on a fork and making a PR for this, but I am not quite sure if this is the right approach.

On top of keeping support for the HasRawWindowHandle, there is also a HasWindowHandle trait now.

Activity

  1. cristianvogel commented on Jan 4, 2025

    @cristianvogel

    I ran into this stuff too httnn/nih-plug-webview#16

  2. MendyBerger commented on Jul 22, 2025

    @MendyBerger

    Would also help with wgpu support

  3. prokopyl commented on Jun 21, 2026

    @prokopyl
    Member

    Implemented in #273 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions