Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(desktop): treat --disable-gpu launches as software rendering; give My Cloud's page the flag

AdityaUmale495e5ce02707
diff --git a/electron/linux-gpu.node-test.mjs b/electron/linux-gpu.node-test.mjs
index 7e39562e56..42d985b0fd 100644
--- a/electron/linux-gpu.node-test.mjs
+++ b/electron/linux-gpu.node-test.mjs
@@ -26,4 +26,7 @@ test("the main window tells its page when it renders without a GPU, so pop-ups d
assert.match(main, /linuxSoftwareRendering \? \[SOFTWARE_RENDERING_ARG\] : \[\]/);
assert.equal(SOFTWARE_RENDERING_ARG, "--omb-software-rendering=1");
assert.match(preload, /softwareRendering: process\.argv\.includes\("--omb-software-rendering=1"\)/);
+ assert.match(main, /linuxDisablesGpu\(\) \|\| app\.commandLine\.hasSwitch\("disable-gpu"\)/);
+ // My Cloud's page is remote: it needs the flag too.
+ assert.match(preload, /const REMOTE_SAFE = new Set\(\[[^\]]*"softwareRendering"/);
});
diff --git a/electron/main.mjs b/electron/main.mjs
index 20bf454151..dfb8aeb146 100644
--- a/electron/main.mjs
+++ b/electron/main.mjs
@@ -178,7 +178,8 @@ function applyUnreadBadge(win = mainWindow) {
}
// GNOME groups the window with its desktop entry only when both identities match; set before ready.
-const linuxSoftwareRendering = process.platform === "linux" && linuxDisablesGpu();
+// A launch with --disable-gpu (a desktop entry or a user workaround) renders on the CPU too.
+const linuxSoftwareRendering = process.platform === "linux" && (linuxDisablesGpu() || app.commandLine.hasSwitch("disable-gpu"));
if (linuxSoftwareRendering) app.disableHardwareAcceleration();
if (process.platform === "linux") app.setDesktopName("com.openmausbot.app.desktop");
diff --git a/electron/preload.cjs b/electron/preload.cjs
index 96d65169bc..5ad63acf94 100644
--- a/electron/preload.cjs
+++ b/electron/preload.cjs
@@ -74,7 +74,7 @@ function railKeepsItsSize() {
if (typeof window !== "undefined") {
for (const type of ["resize", "DOMContentLoaded"]) window.addEventListener(type, () => { leaveRailRoom(); railKeepsItsSize(); });
}
-const REMOTE_SAFE = new Set(["platform", "app", "getCapabilities", "onCapabilitiesChanged", "applySkin", "setUnreadCount", "permStatus", "workspaces", "rail", "cloudAdd", "cloudPlan", "cloudSendPage", "accountSheet", "desktopNotices", "desktopNotifications", "desktopAnalytics", "desktopLanguage", "updatesConsent", "windowControls", "onOpenAppSettings", "windowFrame"]);
+const REMOTE_SAFE = new Set(["platform", "app", "getCapabilities", "onCapabilitiesChanged", "applySkin", "setUnreadCount", "permStatus", "workspaces", "rail", "cloudAdd", "cloudPlan", "cloudSendPage", "accountSheet", "desktopNotices", "desktopNotifications", "desktopAnalytics", "desktopLanguage", "updatesConsent", "windowControls", "onOpenAppSettings", "windowFrame", "softwareRendering"]);
/** My Cloud's own page once it is the person's home (main checks the sender again): it is this app's page then. */
const HOME_PAGE = ["home", "onChatLink", "onPackageInstall", "exportDiagnostics", "openLogsFolder", "openAtLogin", "callActive"];
function updaterOffered() {