Skip to content

Commit

Permalink
Fix missing RawWIndowHandle wraps
Browse files Browse the repository at this point in the history
  • Loading branch information
atlanticaccent committed May 12, 2024
1 parent 6aa35f5 commit fea82bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions druid-shell/src/backend/mac/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use once_cell::sync::Lazy;
use tracing::{debug, error, info};

#[cfg(feature = "raw-win-handle")]
use raw_window_handle::{AppKitWindowHandle, HandleError, HasWindowHandle};
use raw_window_handle::{AppKitWindowHandle, HandleError, HasWindowHandle, RawWindowHandle};

use crate::kurbo::{Insets, Point, Rect, Size, Vec2};
use crate::piet::{Piet, PietText, RenderContext};
Expand Down Expand Up @@ -1469,7 +1469,8 @@ impl HasWindowHandle for WindowHandle {
let nsv = self.nsview.load();
let mut handle = AppKitWindowHandle::new(NonNull::from(&nsv).cast());

let handle = unsafe { raw_window_handle::WindowHandle::borrow_raw(handle) };
let handle =
unsafe { raw_window_handle::WindowHandle::borrow_raw(RawWindowHandle::AppKit(handle)) };
Ok(handle)
}
}
Expand Down
5 changes: 3 additions & 2 deletions druid-shell/src/backend/x11/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use x11rb::wrapper::ConnectionExt as _;
use x11rb::xcb_ffi::XCBConnection;

#[cfg(feature = "raw-win-handle")]
use raw_window_handle::{HandleError, HasWindowHandle, XcbWindowHandle};
use raw_window_handle::{HandleError, HasWindowHandle, RawWindowHandle, XcbWindowHandle};

use crate::backend::shared::Timer;
use crate::common_util::IdleCallback;
Expand Down Expand Up @@ -1908,7 +1908,8 @@ impl HasWindowHandle for WindowHandle {
let mut handle = XcbWindowHandle::new(NonZeroU32::new(self.id).unwrap());
handle.visual_id = std::num::NonZeroU32::new(self.visual_id);

let handle = unsafe { raw_window_handle::WindowHandle::borrow_raw(handle) };
let handle =
unsafe { raw_window_handle::WindowHandle::borrow_raw(RawWindowHandle::Xcb(handle)) };
Ok(handle)
}
}
Expand Down

0 comments on commit fea82bb

Please sign in to comment.