mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
fix: disable souvlaki on Windows to fix startup crash (v1.17.1)
SMTC init via souvlaki requires a valid HWND + COM message loop, which are not available in setup(). Guarded behind #[cfg(not(target_os = "windows"))]. mpris_set_metadata / mpris_set_playback no-op on Windows via the None branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -252,12 +252,18 @@ pub fn run() {
|
||||
.build(app)?;
|
||||
|
||||
// ── MPRIS2 / OS media controls via souvlaki ──────────────────
|
||||
// Windows: souvlaki SMTC init requires a valid HWND and a running
|
||||
// COM message loop, neither of which is available this early in
|
||||
// setup(). Disabled on Windows until we can defer init post-window.
|
||||
// mpris_set_metadata / mpris_set_playback no-op via the None branch.
|
||||
#[cfg(target_os = "windows")]
|
||||
app.manage(MprisControls::new(None));
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
use souvlaki::{MediaControlEvent, MediaControls, PlatformConfig};
|
||||
|
||||
// On Linux, souvlaki requires a live D-Bus session. If the env var
|
||||
// is absent or empty (headless, test, or stripped environment),
|
||||
// skip init entirely — commands will no-op via the None branch.
|
||||
// On Linux, souvlaki requires a live D-Bus session.
|
||||
#[cfg(target_os = "linux")]
|
||||
let dbus_ok = std::env::var("DBUS_SESSION_BUS_ADDRESS")
|
||||
.map(|v| !v.is_empty())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Psysonic",
|
||||
"version": "1.17.0",
|
||||
"version": "1.17.1",
|
||||
"identifier": "dev.psysonic.player",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
Reference in New Issue
Block a user