From 31019d9b6afb56a2284558d9c205b5db683c65fb Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:27:39 -0600 Subject: [PATCH 1/6] fix(graphics): revert to v1.1.9 rendering defaults, fix UI lag Reverts the aggressive GPU disabling introduced in v1.1.10/11 that caused severe UI lag for all users. The previous approach disabled WEBKIT_DISABLE_DMABUF_RENDERER globally (not just NVIDIA) because hardware_accel defaulted to false. New behavior (matches v1.1.9 targeted mitigations): - X11 non-NVIDIA: nothing disabled (full GPU acceleration) - X11 + NVIDIA: only DMA-BUF disabled - Wayland: compositing + DMA-BUF disabled (prevents EGL crashes) - Wayland + force_x11: runs as X11 (XWayland) - VM: software rendering via llvmpipe Improvement over v1.1.9: DMA-BUF now disabled for ALL Wayland GPUs (not just NVIDIA), which prevents the Intel Arc EGL crash from #59. All settings bypassable via env vars: - QBZ_HARDWARE_ACCEL=0 disables all GPU rendering (nuclear opt-out) - QBZ_HARDWARE_ACCEL=1 bypasses all safety (full GPU everywhere) - QBZ_FORCE_X11=1 forces XWayland backend - QBZ_FORCE_DMABUF=1 / QBZ_DISABLE_DMABUF=1 fine-grained DMA-BUF - QBZ_SOFTWARE_RENDER=1 forces Mesa llvmpipe Also adds GDK_SCALE and GDK_DPI_SCALE DB persistence for XWayland scaling (workaround from #67). cc --- src-tauri/src/config/graphics_settings.rs | 72 +++++++++++- src-tauri/src/config/mod.rs | 2 + src-tauri/src/lib.rs | 2 + src-tauri/src/main.rs | 135 +++++++++++++++------- 4 files changed, 162 insertions(+), 49 deletions(-) diff --git a/src-tauri/src/config/graphics_settings.rs b/src-tauri/src/config/graphics_settings.rs index 1a959708b..f88f8e43c 100644 --- a/src-tauri/src/config/graphics_settings.rs +++ b/src-tauri/src/config/graphics_settings.rs @@ -3,10 +3,14 @@ //! Stores GPU/rendering preferences that take effect before WebView initialization. //! These settings are device-level (not per-user) and persist across sessions. //! -//! - hardware_acceleration: opt-in GPU rendering (default: off) -//! Env var QBZ_HARDWARE_ACCEL=1|0 always overrides the stored value. //! - force_x11: force X11/XWayland backend on Wayland sessions (default: off) //! Env var QBZ_FORCE_X11=1|0 always overrides the stored value. +//! - gdk_scale / gdk_dpi_scale: display scaling overrides for XWayland +//! +//! Note: hardware_acceleration is kept in the DB for legacy compatibility but +//! is no longer read at startup. GPU rendering defaults are now determined by +//! auto-detection (Wayland/NVIDIA). Use QBZ_HARDWARE_ACCEL=0 env var to +//! explicitly disable all GPU rendering. use rusqlite::{Connection, params}; use serde::{Deserialize, Serialize}; @@ -14,17 +18,23 @@ use std::sync::{Arc, Mutex}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GraphicsSettings { - /// Enable hardware-accelerated rendering (requires restart) + /// Legacy field (kept for DB compat, not used at startup anymore) pub hardware_acceleration: bool, /// Force X11 (XWayland) backend on Wayland sessions (requires restart) pub force_x11: bool, + /// GDK_SCALE override for XWayland (None = auto). Integer values: "1", "2" + pub gdk_scale: Option, + /// GDK_DPI_SCALE override for XWayland (None = auto). Float values: "0.5", "1", "1.5" + pub gdk_dpi_scale: Option, } impl Default for GraphicsSettings { fn default() -> Self { Self { - hardware_acceleration: false, + hardware_acceleration: true, force_x11: false, + gdk_scale: None, + gdk_dpi_scale: None, } } } @@ -54,10 +64,16 @@ impl GraphicsSettingsStore { INSERT OR IGNORE INTO graphics_settings (id, hardware_acceleration) VALUES (1, 0);" ).map_err(|e| format!("Failed to create graphics settings table: {}", e))?; - // Migration: add force_x11 column (no-op if already present) + // Migrations: add columns (no-op if already present) let _ = conn.execute_batch( "ALTER TABLE graphics_settings ADD COLUMN force_x11 INTEGER NOT NULL DEFAULT 0;" ); + let _ = conn.execute_batch( + "ALTER TABLE graphics_settings ADD COLUMN gdk_scale TEXT;" + ); + let _ = conn.execute_batch( + "ALTER TABLE graphics_settings ADD COLUMN gdk_dpi_scale TEXT;" + ); Ok(Self { conn }) } @@ -65,12 +81,14 @@ impl GraphicsSettingsStore { pub fn get_settings(&self) -> Result { self.conn .query_row( - "SELECT hardware_acceleration, force_x11 FROM graphics_settings WHERE id = 1", + "SELECT hardware_acceleration, force_x11, gdk_scale, gdk_dpi_scale FROM graphics_settings WHERE id = 1", [], |row| { Ok(GraphicsSettings { hardware_acceleration: row.get::<_, i64>(0)? != 0, force_x11: row.get::<_, i64>(1)? != 0, + gdk_scale: row.get::<_, Option>(2)?, + gdk_dpi_scale: row.get::<_, Option>(3)?, }) }, ) @@ -96,6 +114,26 @@ impl GraphicsSettingsStore { .map_err(|e| format!("Failed to set force_x11: {}", e))?; Ok(()) } + + pub fn set_gdk_scale(&self, value: Option) -> Result<(), String> { + self.conn + .execute( + "UPDATE graphics_settings SET gdk_scale = ?1 WHERE id = 1", + params![value], + ) + .map_err(|e| format!("Failed to set gdk_scale: {}", e))?; + Ok(()) + } + + pub fn set_gdk_dpi_scale(&self, value: Option) -> Result<(), String> { + self.conn + .execute( + "UPDATE graphics_settings SET gdk_dpi_scale = ?1 WHERE id = 1", + params![value], + ) + .map_err(|e| format!("Failed to set gdk_dpi_scale: {}", e))?; + Ok(()) + } } /// Thread-safe wrapper for Tauri state management @@ -149,3 +187,25 @@ pub fn set_force_x11( let store = guard.as_ref().ok_or("Graphics settings store not initialized")?; store.set_force_x11(enabled) } + +#[tauri::command] +pub fn set_gdk_scale( + state: tauri::State<'_, GraphicsSettingsState>, + value: Option, +) -> Result<(), String> { + log::info!("[GraphicsSettings] Setting gdk_scale to {:?} (restart required)", value); + let guard = state.store.lock().map_err(|e| format!("Lock error: {}", e))?; + let store = guard.as_ref().ok_or("Graphics settings store not initialized")?; + store.set_gdk_scale(value) +} + +#[tauri::command] +pub fn set_gdk_dpi_scale( + state: tauri::State<'_, GraphicsSettingsState>, + value: Option, +) -> Result<(), String> { + log::info!("[GraphicsSettings] Setting gdk_dpi_scale to {:?} (restart required)", value); + let guard = state.store.lock().map_err(|e| format!("Lock error: {}", e))?; + let store = guard.as_ref().ok_or("Graphics settings store not initialized")?; + store.set_gdk_dpi_scale(value) +} diff --git a/src-tauri/src/config/mod.rs b/src-tauri/src/config/mod.rs index 19c3c4b75..00085d129 100644 --- a/src-tauri/src/config/mod.rs +++ b/src-tauri/src/config/mod.rs @@ -120,6 +120,8 @@ pub use graphics_settings::{ get_graphics_settings, set_hardware_acceleration, set_force_x11, + set_gdk_scale, + set_gdk_dpi_scale, }; pub use window_settings::{ diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 2d63d01d4..de84d4654 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -996,6 +996,8 @@ pub fn run() { config::graphics_settings::get_graphics_settings, config::graphics_settings::set_hardware_acceleration, config::graphics_settings::set_force_x11, + config::graphics_settings::set_gdk_scale, + config::graphics_settings::set_gdk_dpi_scale, // Window settings commands config::window_settings::get_window_settings, config::window_settings::set_use_system_titlebar, diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 0de1e1322..6971bfebb 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -108,13 +108,18 @@ fn main() { // Wayland and WebKit compatibility fixes for Linux // Addresses: https://github.com/vicrodh/qbz/issues/6 // https://github.com/vicrodh/qbz/issues/59 + // https://github.com/vicrodh/qbz/issues/67 // - // The primary EGL crash ("Could not create default EGL display") in - // AppImage is fixed at the build level by pinning WebKitGTK to 2.44.0-2 - // in the CI workflow (see tauri-apps/tauri#11994). - // - // Runtime workarounds below handle NVIDIA DMA-BUF issues, VM detection, - // and provide escape hatches for edge cases. + // v1.1.12: Reverted to v1.1.9 rendering defaults. The v1.1.10/11 approach + // of disabling hardware acceleration by default caused severe UI lag for + // all users (WEBKIT_DISABLE_DMABUF_RENDERER applied globally instead of + // only to NVIDIA GPUs). Now: + // - X11: full hardware acceleration (nothing disabled) + // - Wayland: compositing disabled (prevents protocol errors), DMA-BUF + // disabled on Wayland for all GPUs (prevents EGL crashes on Intel Arc + // and NVIDIA Error 71) + // - NVIDIA on X11: only DMA-BUF disabled + // - Everything bypassable via env vars #[cfg(target_os = "linux")] { let is_wayland = std::env::var_os("WAYLAND_DISPLAY").is_some() @@ -123,25 +128,26 @@ fn main() { let is_vm = is_virtual_machine(); let force_software = std::env::var("QBZ_SOFTWARE_RENDER").as_deref() == Ok("1"); - // Graphics settings: hardware acceleration opt-in (from Settings > Appearance) - // Default is OFF — safest for AppImage across heterogeneous hardware. - // Env var QBZ_HARDWARE_ACCEL=1|0 ALWAYS overrides the DB value (crash recovery). + // Graphics settings from DB (force_x11, scaling) let graphics_db = qbz_nix_lib::config::graphics_settings::GraphicsSettingsStore::new() .ok() .and_then(|store| store.get_settings().ok()); - let hw_accel_db = graphics_db.as_ref().map(|s| s.hardware_acceleration).unwrap_or(false); + + // Hardware acceleration override (env var only — not a DB setting anymore). + // Default: ON (v1.1.9 behavior). QBZ_HARDWARE_ACCEL=0 is the nuclear + // opt-out that disables all GPU compositing and DMA-BUF everywhere. let hardware_accel = match std::env::var("QBZ_HARDWARE_ACCEL").as_deref() { - Ok("1") => { - qbz_nix_lib::logging::log_startup("[QBZ] Env override: QBZ_HARDWARE_ACCEL=1 (GPU rendering forced on)"); - true - } Ok("0") => { - qbz_nix_lib::logging::log_startup("[QBZ] Env override: QBZ_HARDWARE_ACCEL=0 (GPU rendering forced off)"); + qbz_nix_lib::logging::log_startup("[QBZ] Env override: QBZ_HARDWARE_ACCEL=0 (all GPU rendering disabled)"); false } - _ => hw_accel_db, + // "1" is the default behavior, log only if explicitly set + Ok("1") => { + qbz_nix_lib::logging::log_startup("[QBZ] Env override: QBZ_HARDWARE_ACCEL=1 (full GPU, all safety bypassed)"); + true + } + _ => true, // Default: hardware acceleration ON (v1.1.9 behavior) }; - qbz_nix_lib::logging::log_startup(&format!("[QBZ] Hardware acceleration: {}", if hardware_accel { "enabled" } else { "disabled (default)" })); // Developer settings: force_dmabuf override (from Settings > Developer Mode) let dev_force_dmabuf = qbz_nix_lib::config::developer_settings::DeveloperSettingsStore::new() @@ -155,7 +161,7 @@ fn main() { qbz_nix_lib::logging::log_startup("[QBZ] To reset: run `qbz --reset-dmabuf`"); } - // User overrides + // User overrides for DMA-BUF (finer-grained than QBZ_HARDWARE_ACCEL) let force_dmabuf = std::env::var("QBZ_FORCE_DMABUF").as_deref() == Ok("1"); let disable_dmabuf = std::env::var("QBZ_DISABLE_DMABUF").as_deref() == Ok("1"); @@ -173,7 +179,7 @@ fn main() { _ => force_x11_db, }; - // Diagnostic logging (display server logged after GDK backend selection below) + // Diagnostic logging if has_nvidia { qbz_nix_lib::logging::log_startup("[QBZ] NVIDIA GPU detected"); } @@ -183,7 +189,7 @@ fn main() { // --- Software rendering (GL layer) --- // LIBGL_ALWAYS_SOFTWARE=1 forces Mesa to use llvmpipe for all GL contexts. - // Only needed in VMs or when the user explicitly requests it. + // Only for VMs or explicit user request. if force_software { qbz_nix_lib::logging::log_startup("[QBZ] User override: forcing software rendering (QBZ_SOFTWARE_RENDER=1)"); std::env::set_var("LIBGL_ALWAYS_SOFTWARE", "1"); @@ -194,16 +200,24 @@ fn main() { // --- GDK backend selection --- if force_x11 && is_wayland { - qbz_nix_lib::logging::log_startup("[QBZ] User override: Forcing X11 backend (QBZ_FORCE_X11=1)"); + qbz_nix_lib::logging::log_startup("[QBZ] Forcing X11 backend on Wayland session"); std::env::set_var("GDK_BACKEND", "x11"); + + // Apply XWayland display scaling overrides if configured + if let Some(ref gdk_scale) = graphics_db.as_ref().and_then(|s| s.gdk_scale.clone()) { + std::env::set_var("GDK_SCALE", gdk_scale); + qbz_nix_lib::logging::log_startup(&format!("[QBZ] GDK_SCALE={}", gdk_scale)); + } + if let Some(ref gdk_dpi) = graphics_db.as_ref().and_then(|s| s.gdk_dpi_scale.clone()) { + std::env::set_var("GDK_DPI_SCALE", gdk_dpi); + qbz_nix_lib::logging::log_startup(&format!("[QBZ] GDK_DPI_SCALE={}", gdk_dpi)); + } } else if is_wayland && std::env::var_os("GDK_BACKEND").is_none() { std::env::set_var("GDK_BACKEND", "wayland"); std::env::set_var("GTK_CSD", "1"); } - // Log effective display server AFTER GDK backend selection so the - // message reflects what GDK will actually use (not just the session - // type). GDK_BACKEND=x11 on a Wayland session = XWayland. + // Log effective display server AFTER GDK backend selection let effective_display = match std::env::var("GDK_BACKEND").as_deref() { Ok("x11") if is_wayland => "X11 (XWayland)", Ok("x11") => "X11", @@ -212,27 +226,62 @@ fn main() { }; qbz_nix_lib::logging::log_startup(&format!("[QBZ] Display server: {}", effective_display)); - // --- DMA-BUF renderer control --- - // NVIDIA GPUs have known issues with WebKit's DMA-BUF renderer on - // Wayland, causing fatal protocol errors (Error 71). - // When hardware_accel is off, we also disable the DMA-BUF renderer - // as an extra safety layer for AppImage compatibility. - if force_dmabuf { - qbz_nix_lib::logging::log_startup("[QBZ] User override: Forcing DMA-BUF renderer enabled (QBZ_FORCE_DMABUF=1)"); - qbz_nix_lib::logging::log_startup("[QBZ] Warning: This may cause crashes on some Wayland configurations"); - } else if disable_dmabuf { - qbz_nix_lib::logging::log_startup("[QBZ] User override: Forcing DMA-BUF renderer disabled (QBZ_DISABLE_DMABUF=1)"); - std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); - } else if !hardware_accel { - qbz_nix_lib::logging::log_startup("[QBZ] Hardware acceleration disabled: disabling WebKit DMA-BUF renderer"); - qbz_nix_lib::logging::log_startup("[QBZ] To enable: Settings > Appearance > Hardware Acceleration"); - std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); - } else if has_nvidia { - qbz_nix_lib::logging::log_startup("[QBZ] NVIDIA GPU detected: disabling WebKit DMA-BUF renderer"); - qbz_nix_lib::logging::log_startup("[QBZ] To override: set QBZ_FORCE_DMABUF=1 (not recommended)"); + // --- WebKit renderer control --- + // + // QBZ_HARDWARE_ACCEL=0 is the nuclear option: disables everything. + // QBZ_HARDWARE_ACCEL=1 (explicit) bypasses ALL safety measures. + // Default (no env var): v1.1.9 targeted mitigations only. + // + // v1.1.9 defaults: + // - Wayland: COMPOSITING off + DMABUF off (prevents EGL/protocol errors) + // - X11 + NVIDIA: DMABUF off only (prevents Error 71) + // - X11 + non-NVIDIA: nothing disabled (full GPU acceleration) + // + // Override hierarchy (highest to lowest): + // 1. QBZ_HARDWARE_ACCEL=0 → disable everything + // 2. QBZ_HARDWARE_ACCEL=1 → enable everything (bypass all safety) + // 3. QBZ_FORCE_DMABUF=1 / QBZ_DISABLE_DMABUF=1 → fine-grained DMA-BUF + // 4. Auto-detection (Wayland/NVIDIA) + if !hardware_accel { + // Nuclear opt-out: disable all GPU compositing and DMA-BUF + qbz_nix_lib::logging::log_startup("[QBZ] Hardware acceleration disabled: all GPU rendering off"); + qbz_nix_lib::logging::log_startup("[QBZ] To restore: unset QBZ_HARDWARE_ACCEL or set to 1"); std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); + std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1"); + } else if std::env::var("QBZ_HARDWARE_ACCEL").as_deref() == Ok("1") { + // Explicit full GPU: skip ALL safety measures + qbz_nix_lib::logging::log_startup("[QBZ] Full GPU mode: all WebKit safety bypassed"); } else { - qbz_nix_lib::logging::log_startup("[QBZ] Hardware acceleration enabled, using default WebKit renderer"); + // Default path: v1.1.9 targeted mitigations + + // Wayland compositing: disable to prevent protocol errors with + // transparent windows. This was in v1.1.9 and worked fine. + // Only applies to native Wayland (not force_x11/XWayland). + if is_wayland && !force_x11 { + std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1"); + qbz_nix_lib::logging::log_startup("[QBZ] Wayland: compositing mode disabled (prevents protocol errors)"); + } + + // DMA-BUF renderer control + if force_dmabuf { + qbz_nix_lib::logging::log_startup("[QBZ] User override: DMA-BUF renderer forced ON (QBZ_FORCE_DMABUF=1)"); + } else if disable_dmabuf { + qbz_nix_lib::logging::log_startup("[QBZ] User override: DMA-BUF renderer forced OFF (QBZ_DISABLE_DMABUF=1)"); + std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); + } else if is_wayland && !force_x11 { + // Wayland: disable DMA-BUF for ALL GPUs. Prevents: + // - NVIDIA Error 71 (protocol error) + // - Intel Arc EGL crash (Could not create default EGL display) + // This is an improvement over v1.1.9 which only covered NVIDIA. + qbz_nix_lib::logging::log_startup("[QBZ] Wayland: DMA-BUF renderer disabled (prevents EGL crashes)"); + std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); + } else if has_nvidia { + // X11 + NVIDIA: disable DMA-BUF only (keeps full compositing) + qbz_nix_lib::logging::log_startup("[QBZ] NVIDIA on X11: DMA-BUF renderer disabled"); + std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); + } else { + qbz_nix_lib::logging::log_startup("[QBZ] Using default WebKit renderer (full hardware acceleration)"); + } } } From f0b7b2efb929b8fb40c36995c08d652e70e118b1 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Tue, 10 Feb 2026 20:08:09 -0600 Subject: [PATCH 2/6] feat(graphics): add GPU rendering summary to startup logs Shows effective rendering state after all env var decisions: - FULL: compositing GPU + DMA-BUF GPU - partial: which subsystems are on CPU vs GPU - OFF: software rendering via llvmpipe cc --- src-tauri/src/main.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 6971bfebb..e5629d027 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -283,6 +283,24 @@ fn main() { qbz_nix_lib::logging::log_startup("[QBZ] Using default WebKit renderer (full hardware acceleration)"); } } + + // --- GPU rendering summary --- + let sw = std::env::var_os("LIBGL_ALWAYS_SOFTWARE").is_some(); + let comp_off = std::env::var_os("WEBKIT_DISABLE_COMPOSITING_MODE").is_some(); + let dmabuf_off = std::env::var_os("WEBKIT_DISABLE_DMABUF_RENDERER").is_some(); + + let gpu_status = if sw { + "OFF (software rendering via llvmpipe)" + } else if comp_off && dmabuf_off { + "partial (compositing: CPU, DMA-BUF: disabled, GL: GPU)" + } else if comp_off { + "partial (compositing: CPU, DMA-BUF: GPU)" + } else if dmabuf_off { + "partial (compositing: GPU, DMA-BUF: disabled)" + } else { + "FULL (compositing: GPU, DMA-BUF: GPU)" + }; + qbz_nix_lib::logging::log_startup(&format!("[QBZ] GPU rendering: {}", gpu_status)); } qbz_nix_lib::run() From aed7e43c0f0b70c19205f37b31b7ecd41a365ceb Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Tue, 10 Feb 2026 20:32:40 -0600 Subject: [PATCH 3/6] feat(settings): add collapsible Composition section in Appearance Replace the misleading Hardware Acceleration toggle (which was a no-op since v1.1.12 reverted to env-var-only control) and the standalone Force X11 toggle with a collapsible "Composition" subsection that: - Groups all GPU/rendering settings in one place - Shows help text explaining what the section controls - Includes a crash recovery warning with terminal command - Keeps Force X11 toggle (functional, writes to DB) - Adds GDK_SCALE and GDK_DPI_SCALE inputs (shown when Force X11 on) - Lists all env var overrides with descriptions - Translated in all 4 locales (en, es, de, fr) --- src/lib/components/views/SettingsView.svelte | 239 ++++++++++++++++--- src/lib/i18n/locales/de.json | 21 ++ src/lib/i18n/locales/en.json | 48 ++-- src/lib/i18n/locales/es.json | 54 +++-- src/lib/i18n/locales/fr.json | 21 ++ 5 files changed, 315 insertions(+), 68 deletions(-) diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index 4eb9f55e1..fb2711265 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -5,7 +5,7 @@ import { getCurrentWebview } from '@tauri-apps/api/webview'; import { writeText as copyToClipboard } from '@tauri-apps/plugin-clipboard-manager'; import { ask } from '@tauri-apps/plugin-dialog'; - import { ArrowLeft, ChevronRight, ChevronDown, ChevronUp, Loader2, Sun, Moon, SunMoon, HelpCircle, Ban } from 'lucide-svelte'; + import { ArrowLeft, ChevronRight, ChevronDown, ChevronUp, Loader2, Sun, Moon, SunMoon, HelpCircle, Ban, AlertTriangle } from 'lucide-svelte'; import Toggle from '../Toggle.svelte'; import Dropdown from '../Dropdown.svelte'; import DeviceDropdown from '../DeviceDropdown.svelte'; @@ -264,8 +264,10 @@ let storageCollapsed = $state(true); let developerCollapsed = $state(true); let forceDmabuf = $state(false); - let hardwareAcceleration = $state(false); let forceX11 = $state(false); + let gdkScale = $state(''); + let gdkDpiScale = $state(''); + let compositionCollapsed = $state(true); let showLogsModal = $state(false); // Navigation section IDs with translation keys @@ -892,8 +894,9 @@ // Load graphics settings invoke('get_graphics_settings').then((settings: any) => { - hardwareAcceleration = settings.hardware_acceleration; forceX11 = settings.force_x11; + gdkScale = settings.gdk_scale || ''; + gdkDpiScale = settings.gdk_dpi_scale || ''; }).catch(() => {}); // Subscribe to offline state changes @@ -2708,17 +2711,6 @@ } } - async function handleHardwareAccelerationChange(enabled: boolean) { - try { - await invoke('set_hardware_acceleration', { enabled }); - hardwareAcceleration = enabled; - showToast($t('settings.developer.restartRequired'), 'info'); - } catch (err) { - console.error('Failed to set hardware_acceleration:', err); - showToast(String(err), 'error'); - } - } - async function handleForceX11Change(enabled: boolean) { try { await invoke('set_force_x11', { enabled }); @@ -2730,6 +2722,28 @@ } } + async function handleGdkScaleChange() { + try { + const value = gdkScale.trim() || null; + await invoke('set_gdk_scale', { value }); + showToast($t('settings.developer.restartRequired'), 'info'); + } catch (err) { + console.error('Failed to set gdk_scale:', err); + showToast(String(err), 'error'); + } + } + + async function handleGdkDpiScaleChange() { + try { + const value = gdkDpiScale.trim() || null; + await invoke('set_gdk_dpi_scale', { value }); + showToast($t('settings.developer.restartRequired'), 'info'); + } catch (err) { + console.error('Failed to set gdk_dpi_scale:', err); + showToast(String(err), 'error'); + } + } + async function handleForceDmabufChange(enabled: boolean) { try { await invoke('set_developer_force_dmabuf', { enabled }); @@ -3230,19 +3244,96 @@ /> -
-
- {$t('settings.appearance.hardwareAcceleration')} - {$t('settings.appearance.hardwareAccelerationDesc')} -
- handleHardwareAccelerationChange(v)} /> -
-
-
- {$t('settings.appearance.forceX11')} - {$t('settings.appearance.forceX11Desc')} -
- handleForceX11Change(v)} /> + +
+ + {#if !compositionCollapsed} +

{$t('settings.appearance.composition.helpText')}

+ +
+ +
+ {$t('settings.appearance.composition.recoveryNote')} + {$t('settings.appearance.composition.recoveryCmd')} +
+
+ +
+
+ {$t('settings.appearance.composition.forceX11')} + {$t('settings.appearance.composition.forceX11Desc')} +
+ handleForceX11Change(v)} /> +
+ + {#if forceX11} +
+
+ {$t('settings.appearance.composition.gdkScale')} + {$t('settings.appearance.composition.gdkScaleDesc')} +
+ +
+
+
+ {$t('settings.appearance.composition.gdkDpiScale')} + {$t('settings.appearance.composition.gdkDpiScaleDesc')} +
+ +
+ {/if} + +
+ {$t('settings.appearance.composition.envVarsTitle')} +

{$t('settings.appearance.composition.envVarsDesc')}

+
+
+ QBZ_HARDWARE_ACCEL=0 + {$t('settings.appearance.composition.envVarHwAccel0')} +
+
+ QBZ_HARDWARE_ACCEL=1 + {$t('settings.appearance.composition.envVarHwAccel1')} +
+
+ QBZ_FORCE_X11=1 + {$t('settings.appearance.composition.envVarForceX11')} +
+
+ QBZ_SOFTWARE_RENDER=1 + {$t('settings.appearance.composition.envVarSoftwareRender')} +
+
+ QBZ_FORCE_DMABUF=1 + {$t('settings.appearance.composition.envVarForceDmabuf')} +
+
+ QBZ_DISABLE_DMABUF=1 + {$t('settings.appearance.composition.envVarDisableDmabuf')} +
+
+
+ {/if}
@@ -4677,6 +4768,100 @@ flatpak override --user --filesystem=/home/USUARIO/Música com.blitzfc.qbz margin-left: -4px; } + /* Composition subsection (inside Appearance) */ + .composition-subsection { + padding-top: 16px; + margin-top: 8px; + border-top: 1px solid var(--border-color); + } + + .composition-title { + font-size: 14px !important; + } + + .composition-warning { + display: flex; + align-items: flex-start; + gap: 8px; + padding: 10px 12px; + margin-bottom: 16px; + border-radius: 8px; + background: rgba(245, 158, 11, 0.08); + border: 1px solid rgba(245, 158, 11, 0.2); + font-size: 12px; + color: var(--text-secondary); + } + + .composition-warning :global(svg) { + flex-shrink: 0; + color: #f59e0b; + margin-top: 1px; + } + + .recovery-cmd { + display: block; + margin-top: 4px; + padding: 4px 8px; + border-radius: 4px; + background: var(--bg-tertiary); + font-family: monospace; + font-size: 12px; + color: var(--text-primary); + user-select: all; + } + + .composition-input { + width: 80px; + padding: 6px 8px; + border-radius: 8px; + border: 1px solid var(--bg-tertiary); + background: var(--bg-secondary); + color: var(--text-primary); + font-size: 12px; + text-align: center; + } + + .composition-env-section { + margin-top: 16px; + padding-top: 16px; + border-top: 1px solid var(--border-color); + } + + .composition-env-title { + font-size: 13px; + font-weight: 600; + color: var(--text-secondary); + text-transform: uppercase; + letter-spacing: 0.5px; + } + + .env-vars-list { + display: flex; + flex-direction: column; + gap: 6px; + } + + .env-var-row { + display: flex; + align-items: baseline; + gap: 12px; + font-size: 12px; + } + + .env-var-row code { + flex-shrink: 0; + padding: 2px 6px; + border-radius: 4px; + background: var(--bg-tertiary); + font-family: monospace; + font-size: 11px; + color: var(--text-primary); + } + + .env-var-row span { + color: var(--text-muted); + } + .setting-row { display: flex; align-items: center; diff --git a/src/lib/i18n/locales/de.json b/src/lib/i18n/locales/de.json index 3d90a3ed6..9754d0652 100644 --- a/src/lib/i18n/locales/de.json +++ b/src/lib/i18n/locales/de.json @@ -652,6 +652,27 @@ "minimizeToTrayDesc": "Fenster beim Minimieren in den Tray verschieben", "closeToTray": "In den Systemtray schließen", "closeToTrayDesc": "Fenster in den Tray minimieren statt beenden" + }, + "composition": { + "title": "Komposition", + "summary": "Visuelle Rendering- und GPU-Beschleunigungseinstellungen", + "helpText": "Diese Einstellungen steuern, wie QBZ die Benutzeroberflaeche rendert. Falsche Einstellungen koennen zu Abstuerzen oder schlechter Leistung fuehren. Alle Optionen erfordern einen Neustart.", + "recoveryNote": "Falls QBZ nach dem Aendern dieser Einstellungen abstuerzt, starte vom Terminal mit:", + "recoveryCmd": "QBZ_HARDWARE_ACCEL=0 qbz", + "forceX11": "X11-Backend erzwingen (Wayland)", + "forceX11Desc": "XWayland statt nativem Wayland verwenden. Empfohlen fuer NVIDIA-GPUs mit Wayland-Abstuerzen.", + "gdkScale": "Anzeigeskalierung (XWayland)", + "gdkScaleDesc": "GDK_SCALE-Override fuer XWayland. Leer lassen fuer Auto.", + "gdkDpiScale": "DPI-Skalierung (XWayland)", + "gdkDpiScaleDesc": "GDK_DPI_SCALE-Override fuer XWayland. Leer lassen fuer Auto.", + "envVarsTitle": "Umgebungsvariablen (Override)", + "envVarsDesc": "Fuer fortgeschrittene Benutzer. Vor dem Start von QBZ setzen, um alle Einstellungen zu ueberschreiben.", + "envVarHwAccel0": "Gesamtes GPU-Rendering deaktivieren (maximale Kompatibilitaet)", + "envVarHwAccel1": "Volles GPU-Rendering erzwingen (alle Sicherheiten umgehen)", + "envVarForceX11": "XWayland-Backend erzwingen", + "envVarSoftwareRender": "Software-Rendering erzwingen (Mesa llvmpipe)", + "envVarForceDmabuf": "DMA-BUF-Renderer erzwingen (kann abstuerzen)", + "envVarDisableDmabuf": "DMA-BUF-Renderer deaktivieren" } }, "library": { diff --git a/src/lib/i18n/locales/en.json b/src/lib/i18n/locales/en.json index 0e0390e7b..eaa37d0ab 100644 --- a/src/lib/i18n/locales/en.json +++ b/src/lib/i18n/locales/en.json @@ -230,12 +230,16 @@ "playlists": "Playlists" }, "sort": { - "label": "Sort", + "nameAZ": "Name (A-Z)", + "recent": "Recent", + "trackCount": "# of Tracks", + "playCount": "Play Count", + "custom": "Custom", "default": "Default", "newest": "Newest First", "oldest": "Oldest First", - "titleAsc": "Title (A-Z)", - "titleDesc": "Title (Z-A)", + "titleAZ": "Title (A-Z)", + "titleZA": "Title (Z-A)", "artist": "Artist" }, "playlist": { @@ -302,19 +306,6 @@ "suggestSongs": "Suggest songs for this playlist", "suggestionsLargePlaylist": "This playlist has many tracks. Tap the button to generate suggestions." }, - "sort": { - "nameAZ": "Name (A-Z)", - "recent": "Recent", - "trackCount": "# of Tracks", - "playCount": "Play Count", - "custom": "Custom", - "default": "Default", - "newest": "Newest First", - "oldest": "Oldest First", - "titleAZ": "Title (A-Z)", - "titleZA": "Title (Z-A)", - "artist": "Artist" - }, "favorites": { "title": "Favorites", "albums": "Albums", @@ -398,7 +389,7 @@ "lyrics": "Lyrics", "noLyrics": "No lyrics available", "fetchingLyrics": "Fetching lyrics...", -"trackUnavailable": "Track no longer available in Qobuz library", + "trackUnavailable": "Track no longer available in Qobuz library", "credits": "Credits", "trackInfo": "Track Info", "suggestions": "Suggestions", @@ -562,8 +553,6 @@ "parsingHardware": "Parsing hardware information", "limitQualityToDevice": "Limit Quality to Device", "limitQualityToDeviceDesc": "When enabled, overrides the quality setting above if your audio device doesn't support the selected sample rate. Prevents resampling to guarantee bit-perfect playback.", - "audioBackend": "Audio Backend", - "audioBackendDesc": "Choose audio system: Auto (recommended), PipeWire (modern), ALSA Direct (bit-perfect, exclusive), or PulseAudio (legacy).", "alsaPlugin": "ALSA Plugin", "alsaPluginDesc": "hw: Bit-perfect, exclusive. plughw: Auto-convert. pcm: Most compatible.", "hardwareVolume": "Enable Hardware Volume Control", @@ -673,6 +662,27 @@ "minimizeToTrayDesc": "Hide window to tray when minimizing", "closeToTray": "Close to tray", "closeToTrayDesc": "Hide window to tray instead of quitting" + }, + "composition": { + "title": "Composition", + "summary": "Visual rendering and GPU acceleration settings", + "helpText": "These settings control how QBZ renders the UI. Incorrect settings may cause crashes or poor performance. All options require a restart to take effect.", + "recoveryNote": "If QBZ crashes after changing these settings, launch from terminal with:", + "recoveryCmd": "QBZ_HARDWARE_ACCEL=0 qbz", + "forceX11": "Force X11 backend (Wayland)", + "forceX11Desc": "Use XWayland instead of native Wayland. Recommended for NVIDIA GPUs that crash on Wayland.", + "gdkScale": "Display scale (XWayland)", + "gdkScaleDesc": "GDK_SCALE override for XWayland. Leave empty for auto.", + "gdkDpiScale": "DPI scale (XWayland)", + "gdkDpiScaleDesc": "GDK_DPI_SCALE override for XWayland. Leave empty for auto.", + "envVarsTitle": "Environment variable overrides", + "envVarsDesc": "For advanced users. Set these before launching QBZ to override any setting above.", + "envVarHwAccel0": "Disable all GPU rendering (maximum compatibility)", + "envVarHwAccel1": "Force full GPU rendering (bypass all safety)", + "envVarForceX11": "Force XWayland backend", + "envVarSoftwareRender": "Force software rendering (Mesa llvmpipe)", + "envVarForceDmabuf": "Force DMA-BUF renderer on (may crash)", + "envVarDisableDmabuf": "Force DMA-BUF renderer off" } }, "library": { diff --git a/src/lib/i18n/locales/es.json b/src/lib/i18n/locales/es.json index 953d9c270..79dbaf3e9 100644 --- a/src/lib/i18n/locales/es.json +++ b/src/lib/i18n/locales/es.json @@ -230,12 +230,16 @@ "playlists": "Playlists" }, "sort": { - "label": "Ordenar", + "nameAZ": "Nombre (A-Z)", + "recent": "Reciente", + "trackCount": "# de Pistas", + "playCount": "Reproducciones", + "custom": "Personalizado", "default": "Por defecto", - "newest": "Más reciente", - "oldest": "Más antiguo", - "titleAsc": "Título (A-Z)", - "titleDesc": "Título (Z-A)", + "newest": "Más Nuevos", + "oldest": "Más Antiguos", + "titleAZ": "Título (A-Z)", + "titleZA": "Título (Z-A)", "artist": "Artista" }, "playlist": { @@ -302,19 +306,6 @@ "suggestSongs": "Sugerir canciones para esta lista", "suggestionsLargePlaylist": "Esta lista tiene muchas pistas. Presiona el botón para generar sugerencias." }, - "sort": { - "nameAZ": "Nombre (A-Z)", - "recent": "Reciente", - "trackCount": "# de Pistas", - "playCount": "Reproducciones", - "custom": "Personalizado", - "default": "Por defecto", - "newest": "Más Nuevos", - "oldest": "Más Antiguos", - "titleAZ": "Título (A-Z)", - "titleZA": "Título (Z-A)", - "artist": "Artista" - }, "favorites": { "title": "Favoritos", "albums": "Álbumes", @@ -398,7 +389,7 @@ "lyrics": "Letras", "noLyrics": "No hay letras disponibles", "fetchingLyrics": "Buscando letras...", -"trackUnavailable": "Pista ya no disponible en la biblioteca de Qobuz", + "trackUnavailable": "Pista ya no disponible en la biblioteca de Qobuz", "credits": "Créditos", "trackInfo": "Info de Pista", "suggestions": "Sugerencias", @@ -554,7 +545,7 @@ "dacPassthroughDisabledDesc": "DAC Passthrough usa pw-metadata para forzar las tasas de muestreo de PipeWire. Solo es compatible con el backend PipeWire.", "dacPassthroughExtendedDesc": "Cuando está habilitado, anula la configuración de calidad anterior si tu dispositivo de audio no soporta la tasa de muestreo seleccionada. Previene el remuestreo para garantizar reproducción bit-perfect.", "audioBackend": "Backend de Audio", - "audioBackendDesc": "Elige el sistema de audio: Auto (recomendado), PipeWire (moderno), ALSA Direct (bit-perfect, exclusivo), o PulseAudio (legado).", + "audioBackendDesc": "Elige el sistema de audio: Auto (recomendado), PipeWire (moderno), ALSA Direct (bit-perfect, exclusivo), o PulseAudio (legacy).", "currentSampleRate": "Tasa de Muestreo Actual", "noActivePlayback": "Sin reproducción activa", "loadingDevices": "Cargando dispositivos...", @@ -562,8 +553,6 @@ "parsingHardware": "Analizando información de hardware", "limitQualityToDevice": "Limitar Calidad al Dispositivo", "limitQualityToDeviceDesc": "Cuando está activado, anula la configuración de calidad si tu dispositivo de audio no soporta la tasa de muestreo seleccionada. Previene el remuestreo para garantizar reproducción bit-perfect.", - "audioBackend": "Backend de Audio", - "audioBackendDesc": "Elige el sistema de audio: Auto (recomendado), PipeWire (moderno), ALSA Direct (bit-perfect, exclusivo), o PulseAudio (legacy).", "alsaPlugin": "Plugin ALSA", "alsaPluginDesc": "hw: Bit-perfect, exclusivo. plughw: Auto-conversión. pcm: Más compatible.", "hardwareVolume": "Habilitar Control de Volumen por Hardware", @@ -673,6 +662,27 @@ "minimizeToTrayDesc": "Ocultar ventana a la bandeja al minimizar", "closeToTray": "Cerrar a bandeja", "closeToTrayDesc": "Ocultar ventana a la bandeja en vez de cerrar" + }, + "composition": { + "title": "Composicion", + "summary": "Configuracion de renderizado visual y aceleracion GPU", + "helpText": "Estos ajustes controlan como QBZ renderiza la interfaz. Una configuracion incorrecta puede causar crashes o bajo rendimiento. Todas las opciones requieren reiniciar.", + "recoveryNote": "Si QBZ crashea despues de cambiar estos ajustes, ejecuta desde terminal:", + "recoveryCmd": "QBZ_HARDWARE_ACCEL=0 qbz", + "forceX11": "Forzar X11 (Wayland)", + "forceX11Desc": "Usar XWayland en lugar de Wayland nativo. Recomendado para GPUs NVIDIA con crashes en Wayland.", + "gdkScale": "Escala de pantalla (XWayland)", + "gdkScaleDesc": "Override de GDK_SCALE para XWayland. Dejar vacio para auto.", + "gdkDpiScale": "Escala DPI (XWayland)", + "gdkDpiScaleDesc": "Override de GDK_DPI_SCALE para XWayland. Dejar vacio para auto.", + "envVarsTitle": "Variables de entorno (override)", + "envVarsDesc": "Para usuarios avanzados. Configurar antes de ejecutar QBZ para sobreescribir cualquier ajuste.", + "envVarHwAccel0": "Deshabilitar todo el renderizado GPU (maxima compatibilidad)", + "envVarHwAccel1": "Forzar renderizado GPU completo (sin protecciones)", + "envVarForceX11": "Forzar backend XWayland", + "envVarSoftwareRender": "Forzar renderizado por software (Mesa llvmpipe)", + "envVarForceDmabuf": "Forzar DMA-BUF activo (puede crashear)", + "envVarDisableDmabuf": "Forzar DMA-BUF desactivado" } }, "library": { diff --git a/src/lib/i18n/locales/fr.json b/src/lib/i18n/locales/fr.json index d211fe21c..6382ae302 100644 --- a/src/lib/i18n/locales/fr.json +++ b/src/lib/i18n/locales/fr.json @@ -652,6 +652,27 @@ "minimizeToTrayDesc": "Masquer la fenêtre dans la barre d'état lors de la minimisation", "closeToTray": "Réduire dans la barre d'état système", "closeToTrayDesc": "Masquer la fenêtre dans la barre d'état au lieu de quitter" + }, + "composition": { + "title": "Composition", + "summary": "Parametres de rendu visuel et acceleration GPU", + "helpText": "Ces parametres controlent comment QBZ rend l'interface. Des parametres incorrects peuvent causer des crashes ou une mauvaise performance. Toutes les options necessitent un redemarrage.", + "recoveryNote": "Si QBZ plante apres avoir modifie ces parametres, lancez depuis le terminal avec :", + "recoveryCmd": "QBZ_HARDWARE_ACCEL=0 qbz", + "forceX11": "Forcer le backend X11 (Wayland)", + "forceX11Desc": "Utiliser XWayland au lieu du Wayland natif. Recommande pour les GPU NVIDIA avec des crashes sous Wayland.", + "gdkScale": "Echelle d'affichage (XWayland)", + "gdkScaleDesc": "Override GDK_SCALE pour XWayland. Laisser vide pour auto.", + "gdkDpiScale": "Echelle DPI (XWayland)", + "gdkDpiScaleDesc": "Override GDK_DPI_SCALE pour XWayland. Laisser vide pour auto.", + "envVarsTitle": "Variables d'environnement (override)", + "envVarsDesc": "Pour les utilisateurs avances. Definir avant de lancer QBZ pour remplacer tout parametre.", + "envVarHwAccel0": "Desactiver tout le rendu GPU (compatibilite maximale)", + "envVarHwAccel1": "Forcer le rendu GPU complet (contourner toutes les protections)", + "envVarForceX11": "Forcer le backend XWayland", + "envVarSoftwareRender": "Forcer le rendu logiciel (Mesa llvmpipe)", + "envVarForceDmabuf": "Forcer le rendu DMA-BUF (peut planter)", + "envVarDisableDmabuf": "Desactiver le rendu DMA-BUF" } }, "library": { From 968a9d71166ce0c373fcb405f2768af6c78c8ca5 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Thu, 12 Feb 2026 09:45:55 -0600 Subject: [PATCH 4/6] fix: disable gapless when DAC Passthrough is active Cherry-picked from main (ab3dac32) cc --- src/lib/components/views/SettingsView.svelte | 17 +++++++++++++---- src/lib/i18n/locales/de.json | 1 + src/lib/i18n/locales/en.json | 1 + src/lib/i18n/locales/es.json | 1 + src/lib/i18n/locales/fr.json | 1 + 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index fb2711265..4493e1bfc 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -642,14 +642,16 @@ : null ); let gaplessDisabled = $derived( - selectedBackend === 'ALSA Direct' || streamingOnly + selectedBackend === 'ALSA Direct' || streamingOnly || dacPassthrough ); let gaplessDisabledReasonKey = $derived( selectedBackend === 'ALSA Direct' ? 'settings.playback.gaplessDisabledAlsa' - : streamingOnly - ? 'settings.playback.gaplessDisabledStreaming' - : null + : dacPassthrough + ? 'settings.playback.gaplessDisabledDac' + : streamingOnly + ? 'settings.playback.gaplessDisabledStreaming' + : null ); // Playback settings @@ -2135,6 +2137,13 @@ async function handleDacPassthroughChange(enabled: boolean) { dacPassthrough = enabled; + // Gapless not compatible with DAC Passthrough + if (enabled && gaplessPlayback) { + gaplessPlayback = false; + await invoke('set_audio_gapless_enabled', { enabled: false }); + console.log('[Audio] Disabled gapless playback (not compatible with DAC Passthrough)'); + } + try { await invoke('set_audio_dac_passthrough', { enabled }); diff --git a/src/lib/i18n/locales/de.json b/src/lib/i18n/locales/de.json index 9754d0652..404d62a74 100644 --- a/src/lib/i18n/locales/de.json +++ b/src/lib/i18n/locales/de.json @@ -573,6 +573,7 @@ "gapless": "Lückenlose Wiedergabe", "gaplessDesc": "Nahtlose Übergänge zwischen gecachten Titeln mit gleichem Format", "gaplessDisabledAlsa": "Nicht verfügbar mit ALSA Direct-Backend", + "gaplessDisabledDac": "Nicht kompatibel mit DAC Passthrough", "gaplessDisabledStreaming": "Nicht verfügbar im Nur-Streaming-Modus", "experimental": "experimentell", "crossfade": "Überblenden", diff --git a/src/lib/i18n/locales/en.json b/src/lib/i18n/locales/en.json index eaa37d0ab..1e5ecdaaf 100644 --- a/src/lib/i18n/locales/en.json +++ b/src/lib/i18n/locales/en.json @@ -583,6 +583,7 @@ "gapless": "Gapless Playback", "gaplessDesc": "Seamless transitions between cached tracks with matching format", "gaplessDisabledAlsa": "Not available with ALSA Direct backend", + "gaplessDisabledDac": "Not compatible with DAC Passthrough", "gaplessDisabledStreaming": "Not available in streaming-only mode", "experimental": "experimental", "crossfade": "Crossfade", diff --git a/src/lib/i18n/locales/es.json b/src/lib/i18n/locales/es.json index 79dbaf3e9..eaaa12571 100644 --- a/src/lib/i18n/locales/es.json +++ b/src/lib/i18n/locales/es.json @@ -583,6 +583,7 @@ "gapless": "Reproducción Sin Pausas", "gaplessDesc": "Transiciones sin cortes entre pistas en caché con formato compatible", "gaplessDisabledAlsa": "No disponible con el backend ALSA Direct", + "gaplessDisabledDac": "No compatible con DAC Passthrough", "gaplessDisabledStreaming": "No disponible en modo solo streaming", "experimental": "experimental", "crossfade": "Crossfade", diff --git a/src/lib/i18n/locales/fr.json b/src/lib/i18n/locales/fr.json index 6382ae302..ab94d0e95 100644 --- a/src/lib/i18n/locales/fr.json +++ b/src/lib/i18n/locales/fr.json @@ -573,6 +573,7 @@ "gapless": "Lecture sans interruption", "gaplessDesc": "Transitions fluides entre les pistes en cache avec un format compatible", "gaplessDisabledAlsa": "Non disponible avec le backend ALSA Direct", + "gaplessDisabledDac": "Non compatible avec DAC Passthrough", "gaplessDisabledStreaming": "Non disponible en mode streaming uniquement", "experimental": "expérimental", "crossfade": "Fondu enchaîné", From 700183b0bb6787bb8b7d87b3c5e878a695440e64 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Thu, 12 Feb 2026 09:46:03 -0600 Subject: [PATCH 5/6] fix: prevent multiple instances when reopening from desktop icon Cherry-picked from main (c163435b) cc --- src-tauri/Cargo.toml | 1 + src-tauri/src/lib.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 6506b62df..3d8522118 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -16,6 +16,7 @@ tauri-build = { version = "2", features = [] } # Tauri tauri = { version = "2", features = ["protocol-asset", "tray-icon"] } tauri-plugin-opener = "2" +tauri-plugin-single-instance = "2" # Serialization serde = { version = "1", features = ["derive"] } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index de84d4654..910fba36c 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -276,6 +276,14 @@ pub fn run() { let user_data_paths = user_data::UserDataPaths::new(); tauri::Builder::default() + .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| { + // Second instance launched — bring existing window to front + if let Some(window) = app.get_webview_window("main") { + let _ = window.show(); + let _ = window.unminimize(); + let _ = window.set_focus(); + } + })) .plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_clipboard_manager::init()) From a69009d23d9ec66ffde00920b635ab36055aa2f6 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Thu, 12 Feb 2026 09:46:13 -0600 Subject: [PATCH 6/6] feat: add "Make available offline" option for playlists Cherry-picked from main (126a5714) cc --- src/lib/components/AlbumMenu.svelte | 16 +++++- .../views/PlaylistDetailView.svelte | 56 ++++++++++++++++++- src/lib/i18n/locales/de.json | 3 + src/lib/i18n/locales/en.json | 3 + src/lib/i18n/locales/es.json | 3 + src/lib/i18n/locales/fr.json | 3 + 6 files changed, 81 insertions(+), 3 deletions(-) diff --git a/src/lib/components/AlbumMenu.svelte b/src/lib/components/AlbumMenu.svelte index 217922ea9..edbe5df43 100644 --- a/src/lib/components/AlbumMenu.svelte +++ b/src/lib/components/AlbumMenu.svelte @@ -12,6 +12,7 @@ Link, RefreshCw } from 'lucide-svelte'; + import { t } from '$lib/i18n'; import { openMenu as openGlobalMenu, closeMenu as closeGlobalMenu, @@ -27,6 +28,7 @@ onShareQobuz?: () => void; onShareSonglink?: () => void; onDownload?: () => void; + onMakeOffline?: () => void; onOpenChange?: (open: boolean) => void; isAlbumFullyDownloaded?: boolean; onOpenContainingFolder?: () => void; @@ -40,6 +42,7 @@ onShareQobuz, onShareSonglink, onDownload, + onMakeOffline, onOpenChange, isAlbumFullyDownloaded = false, onOpenContainingFolder: _onOpenContainingFolder, @@ -70,7 +73,8 @@ const hasLibrary = $derived(!!onAddToPlaylist); const hasShare = $derived(!!(onShareQobuz || onShareSonglink)); const hasDownload = $derived(!!onDownload || isAlbumFullyDownloaded); - const hasMenu = $derived(hasQueue || hasLibrary || hasShare || hasDownload); + const hasOffline = $derived(!!onMakeOffline); + const hasMenu = $derived(hasQueue || hasLibrary || hasShare || hasDownload || hasOffline); function closeMenu() { isOpen = false; @@ -412,6 +416,16 @@ {/if} {/if} + + {#if hasOffline} + {#if hasDownload || hasShare || hasLibrary || hasQueue} +
+ {/if} + + {/if}
{/if} diff --git a/src/lib/components/views/PlaylistDetailView.svelte b/src/lib/components/views/PlaylistDetailView.svelte index 0af8b7420..3e90c338d 100644 --- a/src/lib/components/views/PlaylistDetailView.svelte +++ b/src/lib/components/views/PlaylistDetailView.svelte @@ -7,11 +7,11 @@ import ViewTransition from '../ViewTransition.svelte'; import { writeText } from '@tauri-apps/plugin-clipboard-manager'; import { invoke } from '@tauri-apps/api/core'; - import { open } from '@tauri-apps/plugin-dialog'; + import { open, ask } from '@tauri-apps/plugin-dialog'; import TrackRow from '../TrackRow.svelte'; import PlaylistSuggestions from '../PlaylistSuggestions.svelte'; import { extractAdaptiveArtists } from '$lib/services/playlistSuggestionsService'; - import { type OfflineCacheStatus } from '$lib/stores/offlineCacheState'; + import { type OfflineCacheStatus, cacheTrackForOffline, getOfflineCacheState } from '$lib/stores/offlineCacheState'; import { subscribe as subscribeOffline, getStatus as getOfflineStatus, @@ -22,6 +22,7 @@ import { isTrackUnavailable, clearTrackUnavailable, subscribe as subscribeUnavailable } from '$lib/stores/unavailableTracksStore'; import { isBlacklisted as isArtistBlacklisted } from '$lib/stores/artistBlacklistStore'; import { showToast } from '$lib/stores/toastStore'; + import { get } from 'svelte/store'; import { t } from '$lib/i18n'; import { onMount, tick } from 'svelte'; @@ -1854,6 +1855,56 @@ const url = `https://play.qobuz.com/playlist/${playlist.id}`; writeText(url); } + + async function handleMakePlaylistOffline() { + const translate = get(t); + // Filter to Qobuz-only tracks (not local) + const qobuzTracks = displayTracks.filter(track => !track.isLocal); + + // Filter out already-cached tracks + const tracksToCache = qobuzTracks.filter(track => { + const status = getOfflineCacheState(track.id).status; + return status === 'none' || status === 'failed'; + }); + + if (tracksToCache.length === 0) { + showToast(translate('toast.allTracksOffline'), 'info'); + return; + } + + // Warn for large playlists + if (tracksToCache.length > 300) { + const confirmed = await ask( + translate('playlist.makeOfflineConfirmDesc', { values: { count: tracksToCache.length } }), + { + title: translate('playlist.makeOfflineConfirmTitle'), + kind: 'warning' + } + ); + if (!confirmed) return; + } + + const playlistName = playlist?.name || ''; + showToast(translate('playlist.preparingPlaylistOffline', { values: { count: tracksToCache.length, name: playlistName } }), 'info'); + + for (const track of tracksToCache) { + try { + await cacheTrackForOffline({ + id: track.id, + title: track.title, + artist: track.artist || 'Unknown', + album: track.album, + albumId: track.albumId, + durationSecs: track.durationSeconds, + quality: '-', + bitDepth: track.bitDepth, + sampleRate: track.samplingRate, + }); + } catch (err) { + console.error(`Failed to queue offline cache for "${track.title}":`, err); + } + } + } @@ -1981,6 +2032,7 @@ onPlayNext={handlePlayAllNext} onPlayLater={handlePlayAllLater} onShareQobuz={sharePlaylistQobuz} + onMakeOffline={handleMakePlaylistOffline} /> diff --git a/src/lib/i18n/locales/de.json b/src/lib/i18n/locales/de.json index 404d62a74..ea75f30d4 100644 --- a/src/lib/i18n/locales/de.json +++ b/src/lib/i18n/locales/de.json @@ -284,6 +284,9 @@ "hideFromSidebar": "Aus Seitenleiste ausblenden", "createAndAdd": "Erstellen und hinzufügen", "playlistWithTracks": "{name} ({count} Titel)", + "makeOfflineConfirmTitle": "Playlist offline verfügbar machen", + "makeOfflineConfirmDesc": "Es werden {count} Titel zum Offline-Hören zwischengespeichert. Dies kann erheblichen Speicherplatz beanspruchen und eine Weile dauern.", + "preparingPlaylistOffline": "{count} Titel aus \"{name}\" werden für Offline-Hören vorbereitet...", "createNewPlaylist": "Neue Playlist erstellen", "newPlaylist": "Neue Playlist", "editPlaylist": "Playlist bearbeiten", diff --git a/src/lib/i18n/locales/en.json b/src/lib/i18n/locales/en.json index 1e5ecdaaf..a7b4e9370 100644 --- a/src/lib/i18n/locales/en.json +++ b/src/lib/i18n/locales/en.json @@ -293,6 +293,9 @@ "hideFromSidebar": "Hide from sidebar", "createAndAdd": "Create & Add", "playlistWithTracks": "{name} ({count} tracks)", + "makeOfflineConfirmTitle": "Make playlist available offline", + "makeOfflineConfirmDesc": "This will cache {count} tracks for offline listening. This may use significant disk space and take a while to complete.", + "preparingPlaylistOffline": "Preparing {count} tracks from \"{name}\" for offline listening...", "copyToLibrary": "Copy to library", "enterName": "Please enter a playlist name", "selectPlaylist": "Please select a playlist", diff --git a/src/lib/i18n/locales/es.json b/src/lib/i18n/locales/es.json index eaaa12571..c806a5122 100644 --- a/src/lib/i18n/locales/es.json +++ b/src/lib/i18n/locales/es.json @@ -293,6 +293,9 @@ "hideFromSidebar": "Ocultar de la barra lateral", "createAndAdd": "Crear y Agregar", "playlistWithTracks": "{name} ({count} pistas)", + "makeOfflineConfirmTitle": "Hacer lista disponible sin conexión", + "makeOfflineConfirmDesc": "Esto almacenará {count} pistas para escuchar sin conexión. Puede usar espacio significativo en disco y tomar un tiempo en completarse.", + "preparingPlaylistOffline": "Preparando {count} pistas de \"{name}\" para escuchar sin conexión...", "copyToLibrary": "Copiar a mi biblioteca", "enterName": "Ingresa un nombre para la lista", "selectPlaylist": "Selecciona una lista", diff --git a/src/lib/i18n/locales/fr.json b/src/lib/i18n/locales/fr.json index ab94d0e95..66cfe1f79 100644 --- a/src/lib/i18n/locales/fr.json +++ b/src/lib/i18n/locales/fr.json @@ -284,6 +284,9 @@ "hideFromSidebar": "Masquer de la barre latérale", "createAndAdd": "Créer et ajouter", "playlistWithTracks": "{name} ({count} pistes)", + "makeOfflineConfirmTitle": "Rendre la playlist disponible hors ligne", + "makeOfflineConfirmDesc": "Cela mettra en cache {count} pistes pour l'écoute hors ligne. Cela peut utiliser un espace disque important et prendre du temps.", + "preparingPlaylistOffline": "Préparation de {count} pistes de \"{name}\" pour l'écoute hors ligne...", "createNewPlaylist": "Créer une nouvelle playlist", "newPlaylist": "Nouvelle playlist", "editPlaylist": "Modifier la playlist",