Skip to content

Commit 28df469

Browse files
Nicolettaclaude
authored andcommitted
fix: GDK_BACKEND=x11 in main() vor GTK-Init – EGL-Crash auf Wayland+AMD
Kernproblem: GDK wird in app_lib::run() initialisiert. Env-Vars die erst in setup() gesetzt werden kommen für den eigenen Prozess zu spät – GDK ignoriert GDK_BACKEND nach der Initialisierung. Lösung: GDK_BACKEND=x11 in main() BEVOR app_lib::run() → GTK/GDK initialisiert sich mit X11-Backend (GLX statt EGL) → eglGetDisplay wird nicht aufgerufen → kein EGL_BAD_PARAMETER auf Mesa 26 + AMD. KDE Plasma hat immer XWayland → X11-Backend funktioniert auf allen Wayland-Systemen mit KDE. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 99b3468 commit 28df469

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src-tauri/src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,13 @@
22
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
33

44
fn main() {
5-
app_lib::run();
5+
// Linux: GDK_BACKEND=x11 MUSS vor GTK-Initialisierung gesetzt werden.
6+
// Tauri initialisiert GTK in run() → danach ignoriert GDK die Env-Var.
7+
// Hintergrund: Mesa 26.0.1 + AMD GPU → eglGetDisplay(EGL_DEFAULT_DISPLAY)
8+
// schlägt auf Wayland fehl (EGL_BAD_PARAMETER). X11-Backend nutzt GLX statt
9+
// EGL → kein eglGetDisplay-Aufruf → kein Crash. KDE Plasma hat immer XWayland.
10+
#[cfg(target_os = "linux")]
11+
std::env::set_var("GDK_BACKEND", "x11");
12+
13+
app_lib::run();
614
}

0 commit comments

Comments
 (0)