diff --git a/src/main/index.ts b/src/main/index.ts index ec3aa87df..2b29e5181 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -272,11 +272,6 @@ if (isLinux() && !process.argv.some((a) => a.startsWith('--password-store='))) { app.commandLine.appendSwitch('password-store', passwordStore); } -// Handle fractional scaling issue from Wayland https://github.com/jeffvli/feishin/issues/1271#issuecomment-4063326712 -if (isLinux()) { - app.commandLine.appendSwitch('disable-features', 'WaylandFractionalScaleV1'); -} - let mainWindow: BrowserWindow | null = null; let tray: null | Tray = null; let exitFromTray = false; @@ -745,11 +740,17 @@ const playbackType = store.get('playbackType', PlayerType.WEB) as PlayerType; const shouldDisableMediaFeatures = isLinux() || !enableMediaSession || playbackType !== PlayerType.WEB; +const chromiumDisabledFeatures: string[] = []; +// Fractional scaling on Wayland: https://github.com/jeffvli/feishin/issues/1271#issuecomment-4063326712 +if (isLinux()) { + chromiumDisabledFeatures.push('WaylandFractionalScaleV1'); +} if (shouldDisableMediaFeatures) { - app.commandLine.appendSwitch( - 'disable-features', - 'HardwareMediaKeyHandling,MediaSessionService', - ); + chromiumDisabledFeatures.push('HardwareMediaKeyHandling', 'MediaSessionService'); +} + +if (chromiumDisabledFeatures.length > 0) { + app.commandLine.appendSwitch('disable-features', chromiumDisabledFeatures.join(',')); } // https://github.com/electron/electron/issues/46538#issuecomment-2808806722