From bb0f0ac3990c1d5684eddd88f512c1496a41ce66 Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Fri, 21 Jun 2024 11:39:12 +0200 Subject: [PATCH 1/2] chore(compass): explicitly set secret store to gnome-libsecret on linux if not set --- packages/compass/src/main/application.ts | 7 ------- .../compass/src/setup-hadron-distribution.ts | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/compass/src/main/application.ts b/packages/compass/src/main/application.ts index 360987067bb..1738892135c 100644 --- a/packages/compass/src/main/application.ts +++ b/packages/compass/src/main/application.ts @@ -139,7 +139,6 @@ class CompassApplication { } await setupCSFLELibrary(); setupTheme(this); - this.setupJavaScriptArguments(); this.setupLifecycleListeners(); this.setupApplicationMenu(); this.setupWindowManager(); @@ -160,12 +159,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 534a402175f..ee0c9bd4bbe 100644 --- a/packages/compass/src/setup-hadron-distribution.ts +++ b/packages/compass/src/setup-hadron-distribution.ts @@ -32,6 +32,26 @@ if ( // type `browser` indicates that we are in the main electron process process.type === 'browser' ) { + if (process.platform === 'linux') { + // 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) { + app.commandLine.appendSwitch('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 From b7967a557d9989f15e041a83e4010e9a86f88fe6 Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Fri, 21 Jun 2024 11:51:23 +0200 Subject: [PATCH 2/2] fix: actually set the flag... --- packages/compass/src/setup-hadron-distribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compass/src/setup-hadron-distribution.ts b/packages/compass/src/setup-hadron-distribution.ts index ee0c9bd4bbe..eed80591236 100644 --- a/packages/compass/src/setup-hadron-distribution.ts +++ b/packages/compass/src/setup-hadron-distribution.ts @@ -48,7 +48,7 @@ if ( * @see {@link https://github.com/microsoft/vscode/issues/185212#issuecomment-1593271415} */ if (app.commandLine.hasSwitch('password-store') === false) { - app.commandLine.appendSwitch('gnome-libsecret'); + app.commandLine.appendSwitch('password-store', 'gnome-libsecret'); } }