From 65a828e3fa23ba1c3c44b95bbbb833c3c1070e8b Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Wed, 25 Mar 2026 22:02:09 +0100 Subject: [PATCH] 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 --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- packages/aur/PKGBUILD | 2 +- src-tauri/src/lib.rs | 12 +++++++++--- src-tauri/tauri.conf.json | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bddd799..55662f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.17.1] - 2026-03-25 + +### Fixed + +- **Windows crash on startup**: souvlaki SMTC init in `setup()` requires a valid HWND and a running COM message loop, neither of which exists at that point. Media controls are disabled on Windows until init can be properly deferred post-window. All other functionality unaffected. + +--- + ## [1.17.0] - 2026-03-25 ### Added diff --git a/package.json b/package.json index 4a5cfa3b..35b88341 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "psysonic", - "version": "1.17.0", + "version": "1.17.1", "private": true, "scripts": { "dev": "vite", diff --git a/packages/aur/PKGBUILD b/packages/aur/PKGBUILD index 31a5ccb3..3bafe26d 100644 --- a/packages/aur/PKGBUILD +++ b/packages/aur/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Psychotoxic pkgname=psysonic -pkgver=1.17.0 +pkgver=1.17.1 pkgrel=1 pkgdesc="Desktop music player for Subsonic API-compatible servers (Navidrome, Gonic, etc.)" arch=('x86_64') diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 57b74590..ae728c25 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -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()) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 4ec4961b..f744018b 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -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",