Skip to content

Commit

Permalink
Wind fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode committed Sep 2, 2024
1 parent 1bfaa59 commit 937aaf6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions psst-gui/src/controller/playback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ use psst_core::{
player::{item::PlaybackItem, PlaybackConfig, Player, PlayerCommand, PlayerEvent},
session::SessionService,
};
use raw_window_handle::{HasWindowHandle, WindowHandle};
use souvlaki::{
MediaControlEvent, MediaControls, MediaMetadata, MediaPlayback, MediaPosition, PlatformConfig,
};
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};

use crate::{
cmd,
Expand Down Expand Up @@ -124,18 +124,22 @@ impl PlaybackController {

fn create_media_controls(
sender: Sender<PlayerEvent>,
window: &WindowHandle,
window: &druid::WindowHandle,
) -> Result<MediaControls, souvlaki::Error> {
let hwnd = {
#[cfg(target_os = "windows")]
{
match window.raw_window_handle() {
use raw_window_handle::RawWindowHandle;
match window.window_handle().unwrap().as_raw() {
RawWindowHandle::Win32(handle) => Some(handle.hwnd.get() as *mut std::ffi::c_void),
_ => None,
}
}
#[cfg(not(target_os = "windows"))]
None
{
let _window = window; // Silence unused variable warning
None
}
};

let mut media_controls = MediaControls::new(PlatformConfig {
Expand Down

0 comments on commit 937aaf6

Please sign in to comment.