handle disabled features in a single flag (#1271)

This commit is contained in:
jeffvli
2026-03-25 17:41:08 -07:00
parent 3b955bb319
commit 9eb64079f7
+10 -9
View File
@@ -272,11 +272,6 @@ if (isLinux() && !process.argv.some((a) => a.startsWith('--password-store='))) {
app.commandLine.appendSwitch('password-store', passwordStore); 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 mainWindow: BrowserWindow | null = null;
let tray: null | Tray = null; let tray: null | Tray = null;
let exitFromTray = false; let exitFromTray = false;
@@ -745,11 +740,17 @@ const playbackType = store.get('playbackType', PlayerType.WEB) as PlayerType;
const shouldDisableMediaFeatures = const shouldDisableMediaFeatures =
isLinux() || !enableMediaSession || playbackType !== PlayerType.WEB; 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) { if (shouldDisableMediaFeatures) {
app.commandLine.appendSwitch( chromiumDisabledFeatures.push('HardwareMediaKeyHandling', 'MediaSessionService');
'disable-features', }
'HardwareMediaKeyHandling,MediaSessionService',
); if (chromiumDisabledFeatures.length > 0) {
app.commandLine.appendSwitch('disable-features', chromiumDisabledFeatures.join(','));
} }
// https://github.com/electron/electron/issues/46538#issuecomment-2808806722 // https://github.com/electron/electron/issues/46538#issuecomment-2808806722