From b61dad4b4304b5c91036548c52c7227e2f90d27d Mon Sep 17 00:00:00 2001 From: Yuxuan Sun Date: Sat, 2 May 2026 18:27:11 +0900 Subject: [PATCH] fix(frontend): prevent selecting theme from causing segfault on Linux (#2502) --- src/components/theme-provider.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/theme-provider.tsx b/src/components/theme-provider.tsx index f730241e5..8eba9b979 100644 --- a/src/components/theme-provider.tsx +++ b/src/components/theme-provider.tsx @@ -5,6 +5,7 @@ import React, { useMemo, useState, } from "react"; +import { isLinux } from "@/lib/platform"; import { invoke } from "@tauri-apps/api/core"; type Theme = "light" | "dark" | "system"; @@ -147,7 +148,12 @@ export function ThemeProvider({ ); // Use View Transitions API if available, otherwise fall back to instant change - if (document.startViewTransition) { + // Disable for Linux, since WebKitGTK crashes on `document.startViewTransition` + if ( + typeof document !== "undefined" && + document.startViewTransition && + !isLinux() + ) { document.startViewTransition(() => { setThemeState(nextTheme); });