From 8698cca4faab12ee3da310c6f0fbdbb088acd9c7 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 01:59:20 +0000 Subject: [PATCH] =?UTF-8?q?[170]=20Linux:=20unter=20Wayland=20nativ=20star?= =?UTF-8?q?ten=20(ozone=20wayland,=20GPU-Modus=20minimal)=20statt=20XWayla?= =?UTF-8?q?nd=20=E2=80=94=20kein=20schwarzer=20Rand=20in=20runden=20Fenste?= =?UTF-8?q?recken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/electron-main.cjs | 17 +++++++++-------- scripts/electron-shell.sh | 4 ++-- scripts/install-linux-commands.sh | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/scripts/electron-main.cjs b/scripts/electron-main.cjs index e864df56..7a95b107 100644 --- a/scripts/electron-main.cjs +++ b/scripts/electron-main.cjs @@ -20,16 +20,17 @@ Menu.setApplicationMenu(null); // Gleiche Flags wie scripts/chromium-shell.sh — WebGPU liegt unter Linux // hinter --enable-unsafe-webgpu, und WebGPU braucht das Vulkan-Backend. app.commandLine.appendSwitch("enable-unsafe-webgpu"); -// DOSSIER_GPU: „vulkan“ (Vorgabe, wie bisher: Skia + ANGLE über Vulkan), „angle“ (nur ANGLE über Vulkan, Skia/Compositor -// auf GL — hilft, wenn „Failed to create vulkan surface“ erscheint und das Fenster leer bleibt), „minimal“ (nur WebGPU -// freigeben, sonst Chromium-Vorgaben). Zum Ausprobieren: DOSSIER_GPU=angle dossier. -const gpu = process.env.DOSSIER_GPU || "vulkan"; +// Unter Wayland läuft Dossier nativ (`--ozone-platform=wayland`) mit GPU-Modus „minimal“: Chromiums Vulkan-Compositor +// verträgt sich nicht mit Wayland („not compatible with Vulkan“), und über XWayland zeigt der Compositor einen +// schwarzen Rand in abgerundeten Fensterecken (Test Maintainer, Void/Wayland, 13.11.). Übersteuerbar: DOSSIER_OZONE=wayland|x11. +const wayland = !!(process.env.WAYLAND_DISPLAY || process.env.XDG_SESSION_TYPE === "wayland"); +const ozone = process.env.DOSSIER_OZONE || (wayland ? "wayland" : ""); +// DOSSIER_GPU: „vulkan“ (Vorgabe ausser unter Wayland: Skia + ANGLE über Vulkan), „angle“ (nur ANGLE über Vulkan, Skia/ +// Compositor auf GL), „minimal“ (nur WebGPU freigeben, sonst Chromium-Vorgaben; Vorgabe unter nativem Wayland). +const gpu = process.env.DOSSIER_GPU || (ozone === "wayland" ? "minimal" : "vulkan"); if (gpu === "vulkan") app.commandLine.appendSwitch("enable-features", "Vulkan,VulkanFromANGLE,DefaultANGLEVulkan"); else if (gpu === "angle") app.commandLine.appendSwitch("enable-features", "VulkanFromANGLE,DefaultANGLEVulkan"); -console.log(`[dossier] GPU-Modus: ${gpu}`); -// Unter Wayland verträgt sich Chromiums Vulkan nicht mit `--ozone-platform=wayland` („not compatible with Vulkan“, -// das Fenster geht sofort wieder zu) → über XWayland (x11) starten. Übersteuerbar: DOSSIER_OZONE=wayland|x11. -const ozone = process.env.DOSSIER_OZONE || (process.env.WAYLAND_DISPLAY || process.env.XDG_SESSION_TYPE === "wayland" ? "x11" : ""); +console.log(`[dossier] GPU-Modus: ${gpu}${ozone ? `, Plattform: ${ozone}` : ""}`); if (ozone) app.commandLine.appendSwitch("ozone-platform", ozone); const DEV_URL = "http://localhost:5187"; diff --git a/scripts/electron-shell.sh b/scripts/electron-shell.sh index aa77576d..7e871378 100755 --- a/scripts/electron-shell.sh +++ b/scripts/electron-shell.sh @@ -47,7 +47,7 @@ cleanup() { trap cleanup EXIT echo "electron-shell: öffne Electron-Fenster …" -# Unter Wayland: Chromiums Vulkan (WebGPU) läuft nur über XWayland (`--ozone-platform=x11`); DOSSIER_OZONE übersteuert. +# Unter Wayland nativ (`--ozone-platform=wayland`, GPU-Modus „minimal“ in electron-main.cjs); DOSSIER_OZONE übersteuert. OZONE="${DOSSIER_OZONE:-}" -if [ -z "$OZONE" ] && { [ -n "${WAYLAND_DISPLAY:-}" ] || [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; }; then OZONE=x11; fi +if [ -z "$OZONE" ] && { [ -n "${WAYLAND_DISPLAY:-}" ] || [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; }; then OZONE=wayland; fi npx electron ${OZONE:+--ozone-platform=$OZONE} "$(dirname "$0")/electron-main.cjs" diff --git a/scripts/install-linux-commands.sh b/scripts/install-linux-commands.sh index 18df5745..5c475d89 100755 --- a/scripts/install-linux-commands.sh +++ b/scripts/install-linux-commands.sh @@ -23,8 +23,8 @@ cat >"$bin/dossier" </dev/null | head -1) -# Wayland: WebGPU/Vulkan nur über XWayland. -oz=\${DOSSIER_OZONE:-}; if [ -z "\$oz" ] && { [ -n "\${WAYLAND_DISPLAY:-}" ] || [ "\${XDG_SESSION_TYPE:-}" = wayland ]; }; then oz=x11; fi +# Wayland: nativ (über XWayland schwarzer Rand in runden Fensterecken); GPU-Modus „minimal“ setzt electron-main.cjs. +oz=\${DOSSIER_OZONE:-}; if [ -z "\$oz" ] && { [ -n "\${WAYLAND_DISPLAY:-}" ] || [ "\${XDG_SESSION_TYPE:-}" = wayland ]; }; then oz=wayland; fi if [ ! -d node_modules ] && [ -n "\$app" ]; then exec "\$app" \${oz:+--ozone-platform=\$oz} "\$@"; fi exec npm run electron -- "\$@" EOF