fix: auto-detect KDE/Plasma and disable GTK CSD to fix titlebar button freeze (#4380)

* fix: auto-detect KDE/Plasma and disable GTK CSD to fix titlebar button freeze

* chore: update UPDATELOG

---------

Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
Sergey Kharenko
2025-08-12 19:27:46 +08:00
committed by GitHub
parent 67ee41c5ea
commit 45e69543b3
2 changed files with 18 additions and 1 deletions

View File

@@ -423,7 +423,23 @@ pub fn run() {
// Set Linux environment variable
#[cfg(target_os = "linux")]
std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
{
std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
let desktop_env = std::env::var("XDG_CURRENT_DESKTOP").unwrap_or_default().to_uppercase();
let is_kde_desktop = desktop_env.contains("KDE");
let is_plasma_desktop = desktop_env.contains("PLASMA");
if is_kde_desktop || is_plasma_desktop {
std::env::set_var("GTK_CSD", "0");
logging!(
info,
Type::Setup,
true,
"KDE detected: Disabled GTK CSD for better titlebar stability."
);
}
}
// Create and configure the Tauri builder
let builder = app_init::setup_plugins(tauri::Builder::default())