[170] Linux: unter Wayland nativ starten (ozone wayland, GPU-Modus minimal) statt XWayland — kein schwarzer Rand in runden Fensterecken
This commit is contained in:
3 files changed
+13
-12
No files matched your search
@@ -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";
|
||||
|
||||
@@ -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"
|
||||
@@ -23,8 +23,8 @@ cat >"$bin/dossier" <<EOF
|
||||
cd "$repo"
|
||||
# Ohne node_modules (Test-Rechner, update-dossier --tester) das zuletzt gebaute AppImage, sonst aus dem Quellcode.
|
||||
app=\$(ls -1t release/Dossier-*.AppImage 2>/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
|
||||
|
||||
Reference in new issue
Block a user