diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd2fe3db..aa6ddf30 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,7 +83,7 @@ jobs: - name: Bundle macOS Release if: runner.os == 'macOS' run: cargo bundle --release - # working-directory: psst-gui + working-directory: psst-gui - name: Create macOS universal binary if: runner.os == 'macOS' diff --git a/psst-gui/src/controller/playback.rs b/psst-gui/src/controller/playback.rs index 0ddb4984..41bf61da 100644 --- a/psst-gui/src/controller/playback.rs +++ b/psst-gui/src/controller/playback.rs @@ -128,10 +128,11 @@ impl PlaybackController { let hwnd = { #[cfg(target_os = "windows")] { - use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; - let handle = unsafe { window.raw_window_handle() }; - match handle { - RawWindowHandle::Win32(h) => Some(h.hwnd as *mut std::ffi::c_void), + use raw_window_handle::{HasWindowHandle, RawWindowHandle}; + let handle = window.window_handle() + .map_err(|_| souvlaki::Error::UnsupportedPlatform)?; + match handle.as_raw() { + RawWindowHandle::Win32(h) => Some(h.hwnd.get() as *mut std::ffi::c_void), _ => None, } }