Skip to content

Commit 9df456d

Browse files
committed
fix(electron): force XWayland for Hyprland/Wayland compositors
Hyprland uses a custom Wayland compositor that is incompatible with Electron's native Wayland backend. The window flickers because Hyprland tries to apply entrance animations to a Wayland-native Electron surface that keeps resizing during initial page load. Force XWayland via two mechanisms: - --ozone-platform=x11 (Chromium backend) - ELECTRON_OZONE_PLATFORM_HINT=x11 (Electron runtime) This makes Electron run through XWayland on Hyprland, which is fully stable and eliminates the flickering.
1 parent 2815780 commit 9df456d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/desktop-electron/src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ if (process.platform === "linux") {
2222
app.disableHardwareAcceleration();
2323
app.commandLine.appendSwitch("disable-gpu-vsync");
2424
app.commandLine.appendSwitch("disable-software-rasterizer");
25+
// Force XWayland on Hyprland/Wayland — native Wayland is broken in Electron
2526
app.commandLine.appendSwitch("ozone-platform", "x11");
27+
app.commandLine.appendSwitch("ozone-platform-hint", "x11");
28+
process.env.ELECTRON_OZONE_PLATFORM_HINT = "x11";
2629
app.commandLine.appendSwitch("enable-features", "VaapiVideoDecodeLinuxGL");
2730
}
2831

0 commit comments

Comments
 (0)