Skip to content

Commit

Permalink
Fix win?
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode committed Sep 1, 2024
1 parent 1631d97 commit e0536e9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions psst-gui/src/controller/playback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@ impl PlaybackController {
let hwnd = {
#[cfg(target_os = "windows")]
{
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};
let handle = match window.raw_window_handle() {
RawWindowHandle::Win32(h) => h,
_ => unreachable!(),
};
Some(handle.hwnd)
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
let handle = window
.window_handle()
.map_err(|_| souvlaki::Error::Other("Failed to get window handle".into()))?;
match handle.as_raw() {
RawWindowHandle::Win32(h) => Some(h.hwnd.get() as *mut std::ffi::c_void),
_ => None,
}
}
#[cfg(not(target_os = "windows"))]
None
Expand Down

0 comments on commit e0536e9

Please sign in to comment.