diff --git a/scripts/electron-main.cjs b/scripts/electron-main.cjs index e9c79568..7c00739d 100644 --- a/scripts/electron-main.cjs +++ b/scripts/electron-main.cjs @@ -21,6 +21,10 @@ Menu.setApplicationMenu(null); // hinter --enable-unsafe-webgpu, und WebGPU braucht das Vulkan-Backend. app.commandLine.appendSwitch("enable-unsafe-webgpu"); app.commandLine.appendSwitch("enable-features", "Vulkan,VulkanFromANGLE,DefaultANGLEVulkan"); +// 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" : ""); +if (ozone) app.commandLine.appendSwitch("ozone-platform", ozone); const DEV_URL = "http://localhost:5187"; const isDev = !app.isPackaged && !process.env.DOSSIER_USE_DIST; // DOSSIER_USE_DIST=1: gebautes dist ohne Paket prüfen diff --git a/scripts/electron-shell.sh b/scripts/electron-shell.sh index 14a14ac6..aa77576d 100755 --- a/scripts/electron-shell.sh +++ b/scripts/electron-shell.sh @@ -47,4 +47,7 @@ cleanup() { trap cleanup EXIT echo "electron-shell: öffne Electron-Fenster …" -npx electron "$(dirname "$0")/electron-main.cjs" +# Unter Wayland: Chromiums Vulkan (WebGPU) läuft nur über XWayland (`--ozone-platform=x11`); DOSSIER_OZONE übersteuert. +OZONE="${DOSSIER_OZONE:-}" +if [ -z "$OZONE" ] && { [ -n "${WAYLAND_DISPLAY:-}" ] || [ "${XDG_SESSION_TYPE:-}" = "wayland" ]; }; then OZONE=x11; 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 edc67159..18df5745 100755 --- a/scripts/install-linux-commands.sh +++ b/scripts/install-linux-commands.sh @@ -23,7 +23,9 @@ cat >"$bin/dossier" </dev/null | head -1) -if [ ! -d node_modules ] && [ -n "\$app" ]; then exec "\$app" "\$@"; fi +# Wayland: WebGPU/Vulkan nur über XWayland. +oz=\${DOSSIER_OZONE:-}; if [ -z "\$oz" ] && { [ -n "\${WAYLAND_DISPLAY:-}" ] || [ "\${XDG_SESSION_TYPE:-}" = wayland ]; }; then oz=x11; fi +if [ ! -d node_modules ] && [ -n "\$app" ]; then exec "\$app" \${oz:+--ozone-platform=\$oz} "\$@"; fi exec npm run electron -- "\$@" EOF