fix(electron): remove forced X11 mode on Linux

Remove the code that forced X11 mode on Linux via --ozone-platform=x11.
This was causing the snap package to crash on Wayland systems due to
GPU driver mismatches between the bundled Mesa drivers and host system.

The IdleTimeHandler already has proper fallbacks for Wayland environments
(gnomeDBus, xprintidle, loginctl), so forcing X11 is not necessary.

Closes #5663
This commit is contained in:
Johannes Millan 2025-12-06 11:54:41 +01:00
parent e1c9a8a1a9
commit 152939a866

View file

@ -73,21 +73,6 @@ export const startApp = (): void => {
// https://github.com/electron/electron/issues/46538#issuecomment-2808806722
app.commandLine.appendSwitch('gtk-version', '3');
// Force X11 on Linux by default (Electron 38+ defaults to Wayland via --ozone-platform=auto)
// Wayland has known issues:
// - Idle detection fallbacks are unreliable (#1443)
// - Global shortcuts require manual system configuration (GlobalShortcutsPortal)
// Users can override with --ozone-platform=wayland if desired
if (process.platform === 'linux') {
const forceWayland = process.argv.some(
(arg) =>
arg.includes('--ozone-platform=wayland') || arg.includes('--force-wayland'),
);
if (!forceWayland) {
app.commandLine.appendSwitch('ozone-platform', 'x11');
}
}
// NOTE: needs to be executed before everything else
process.argv.forEach((val) => {
if (val && val.includes('--disable-tray')) {