feat: add persistent Force X11 setting for Wayland crash workaround
Add a toggle in Settings > Appearance to force X11 (XWayland) backend on Wayland sessions. Persisted in graphics_settings.db, env var QBZ_FORCE_X11=1|0 overrides for crash recovery. Also fixes the display server log to report effective GDK backend instead of session type.
This commit is contained in:
1 parent
d3d719c609
commit
0f31dcd310
9 files changed
+83
-8
No files matched your search
@@ -265,6 +265,7 @@
|
||||
let developerCollapsed = $state(true);
|
||||
let forceDmabuf = $state(false);
|
||||
let hardwareAcceleration = $state(false);
|
||||
let forceX11 = $state(false);
|
||||
let showLogsModal = $state(false);
|
||||
|
||||
// Navigation section IDs with translation keys
|
||||
@@ -892,6 +893,7 @@
|
||||
// Load graphics settings
|
||||
invoke('get_graphics_settings').then((settings: any) => {
|
||||
hardwareAcceleration = settings.hardware_acceleration;
|
||||
forceX11 = settings.force_x11;
|
||||
}).catch(() => {});
|
||||
|
||||
// Subscribe to offline state changes
|
||||
@@ -2717,6 +2719,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function handleForceX11Change(enabled: boolean) {
|
||||
try {
|
||||
await invoke('set_force_x11', { enabled });
|
||||
forceX11 = enabled;
|
||||
showToast($t('settings.developer.restartRequired'), 'info');
|
||||
} catch (err) {
|
||||
console.error('Failed to set force_x11:', err);
|
||||
showToast(String(err), 'error');
|
||||
}
|
||||
}
|
||||
|
||||
async function handleForceDmabufChange(enabled: boolean) {
|
||||
try {
|
||||
await invoke('set_developer_force_dmabuf', { enabled });
|
||||
@@ -3224,6 +3237,13 @@
|
||||
</div>
|
||||
<Toggle enabled={hardwareAcceleration} onchange={(v) => handleHardwareAccelerationChange(v)} />
|
||||
</div>
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<span class="setting-label">{$t('settings.appearance.forceX11')}</span>
|
||||
<span class="setting-desc">{$t('settings.appearance.forceX11Desc')}</span>
|
||||
</div>
|
||||
<Toggle enabled={forceX11} onchange={(v) => handleForceX11Change(v)} />
|
||||
</div>
|
||||
|
||||
<!-- System Tray subsection -->
|
||||
<h4 class="subsection-title">{$t('settings.appearance.tray.title')}</h4>
|
||||
|
||||
@@ -642,6 +642,8 @@
|
||||
},
|
||||
"hardwareAcceleration": "Hardwarebeschleunigung (GPU)",
|
||||
"hardwareAccelerationDesc": "GPU-beschleunigtes Rendering aktivieren. Standardmäßig deaktiviert für maximale Kompatibilität. Falls QBZ nach dem Aktivieren beim Start abstürzt: QBZ_HARDWARE_ACCEL=0 qbz",
|
||||
"forceX11": "X11-Backend erzwingen (Wayland)",
|
||||
"forceX11Desc": "X11 (XWayland) statt nativem Wayland verwenden. Hilft bei Abstürzen mit bestimmten NVIDIA/Wayland-Konfigurationen. Neustart erforderlich. Override: QBZ_FORCE_X11=0 qbz",
|
||||
"tray": {
|
||||
"title": "Systemtray",
|
||||
"enableTray": "Tray-Symbol aktivieren",
|
||||
|
||||
@@ -663,6 +663,8 @@
|
||||
},
|
||||
"hardwareAcceleration": "Hardware acceleration (GPU)",
|
||||
"hardwareAccelerationDesc": "Enable GPU-accelerated rendering. Disabled by default for maximum compatibility. If QBZ crashes on startup after enabling, run: QBZ_HARDWARE_ACCEL=0 qbz",
|
||||
"forceX11": "Force X11 backend (Wayland)",
|
||||
"forceX11Desc": "Use X11 (XWayland) instead of native Wayland. Helps with crashes on some NVIDIA/Wayland setups. Requires restart. Override: QBZ_FORCE_X11=0 qbz",
|
||||
"tray": {
|
||||
"title": "System Tray",
|
||||
"enableTray": "Enable tray icon",
|
||||
|
||||
@@ -663,6 +663,8 @@
|
||||
},
|
||||
"hardwareAcceleration": "Aceleración por hardware (GPU)",
|
||||
"hardwareAccelerationDesc": "Habilitar renderizado acelerado por GPU. Desactivado por defecto para máxima compatibilidad. Si QBZ se cierra al iniciar después de activar esto, ejecuta: QBZ_HARDWARE_ACCEL=0 qbz",
|
||||
"forceX11": "Forzar backend X11 (Wayland)",
|
||||
"forceX11Desc": "Usar X11 (XWayland) en lugar de Wayland nativo. Ayuda con crashes en configuraciones NVIDIA/Wayland. Requiere reinicio. Override: QBZ_FORCE_X11=0 qbz",
|
||||
"tray": {
|
||||
"title": "Bandeja del Sistema",
|
||||
"enableTray": "Habilitar icono de bandeja",
|
||||
|
||||
@@ -642,6 +642,8 @@
|
||||
},
|
||||
"hardwareAcceleration": "Accélération matérielle (GPU)",
|
||||
"hardwareAccelerationDesc": "Activer le rendu accéléré par GPU. Désactivé par défaut pour une compatibilité maximale. Si QBZ plante au démarrage après activation : QBZ_HARDWARE_ACCEL=0 qbz",
|
||||
"forceX11": "Forcer le backend X11 (Wayland)",
|
||||
"forceX11Desc": "Utiliser X11 (XWayland) au lieu de Wayland natif. Aide avec les plantages sur certaines configurations NVIDIA/Wayland. Redémarrage requis. Override : QBZ_FORCE_X11=0 qbz",
|
||||
"tray": {
|
||||
"title": "Barre d'état système",
|
||||
"enableTray": "Activer l'icône dans la barre système",
|
||||
|
||||
Reference in new issue
Block a user