diff --git a/packages/compass/src/main/application.ts b/packages/compass/src/main/application.ts index eac65757320..e2e825df106 100644 --- a/packages/compass/src/main/application.ts +++ b/packages/compass/src/main/application.ts @@ -165,7 +165,6 @@ class CompassApplication { } await setupCSFLELibrary(); setupTheme(this); - this.setupJavaScriptArguments(); this.setupLifecycleListeners(); this.setupApplicationMenu(); this.setupWindowManager(); @@ -186,12 +185,6 @@ class CompassApplication { }); } - private static setupJavaScriptArguments(): void { - // For Linux users with drivers that are avoided by Chromium we disable the - // GPU check to attempt to bypass the disabled WebGL settings. - app.commandLine.appendSwitch('ignore-gpu-blacklist', 'true'); - } - private static setupAutoUpdate(): void { CompassAutoUpdateManager.init(this); } diff --git a/packages/compass/src/setup-hadron-distribution.ts b/packages/compass/src/setup-hadron-distribution.ts index ea8ba62212a..5dfd772c682 100644 --- a/packages/compass/src/setup-hadron-distribution.ts +++ b/packages/compass/src/setup-hadron-distribution.ts @@ -32,6 +32,38 @@ if ( // type `browser` indicates that we are in the main electron process process.type === 'browser' ) { + if (process.platform === 'linux') { + const isLibsecretInstalled = () => { + try { + process.dlopen({ exports: {} }, 'libsecret-1.so.0'); + return true; + } catch (err: any) { + return err && err.message?.includes('did not self-register'); + } + }; + + // For Linux users with drivers that are avoided by Chromium we disable the + // GPU check to attempt to bypass the disabled WebGL settings. + app.commandLine.appendSwitch('ignore-gpu-blacklist', 'true'); + + /** + * Default password store detection in Chromium relies on pre-defined set of + * values for XDG_CURRENT_DESKTOP env var. Even if the store is installed + * correctly, Chromium might fail to detect that. To try to work around that + * we explicitly set password-store to gnome-libsecret for any linux + * platform (we list gnome-keyring as a dependency for all compass + * installers on linux) + * + * @see {@link https://github.com/microsoft/vscode/issues/185212#issuecomment-1593271415} + */ + if ( + app.commandLine.hasSwitch('password-store') === false && + isLibsecretInstalled() + ) { + app.commandLine.appendSwitch('password-store', 'gnome-libsecret'); + } + } + // Name and version are setup outside of Application and before anything else // so that if uncaught exception happens we already show correct name and // version