1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Allowing to disable hardware acceleration

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-10-23 15:42:49 +03:00
parent 2a9d39a8b9
commit cd9a442fe1
3 changed files with 23 additions and 1 deletions

View File

@ -27,6 +27,7 @@ export interface UserPreferences {
downloadKubectlBinaries?: boolean;
downloadBinariesPath?: string;
kubectlBinariesPath?: string;
disableHardwareAcceleration?: boolean;
}
export class UserStore extends BaseStore<UserStoreModel> {

View File

@ -56,7 +56,6 @@ async function main() {
// preload configuration from stores
await Promise.all([
userStore.load(),
clusterStore.load(),
workspaceStore.load(),
]);
@ -77,6 +76,12 @@ async function main() {
windowManager = new WindowManager(proxyPort);
}
// Disable hardware acceleration if flag is checked in Preferences
userStore.load();
if (userStore.preferences.disableHardwareAcceleration) {
app.disableHardwareAcceleration();
}
app.on("ready", main);
app.on("will-quit", async (event) => {

View File

@ -17,6 +17,7 @@ import { themeStore } from "../../theme.store";
import { history } from "../../navigation";
import { Tooltip } from "../tooltip";
import { KubectlBinaries } from "./kubectl-binaries";
import { isMac } from "../../../common/vars";
@observer
export class Preferences extends React.Component {
@ -194,6 +195,21 @@ export class Preferences extends React.Component {
<small className="hint">
<Trans>Telemetry & usage data is collected to continuously improve the Lens experience.</Trans>
</small>
{isMac && (
<>
<h2><Trans>Hardware Acceleration</Trans></h2>
<Checkbox
label={<Trans>Disable hardware acceleration</Trans>}
value={preferences.disableHardwareAcceleration}
onChange={v => preferences.disableHardwareAcceleration = v}
/>
<small className="hint">
<Trans>Enabled hardware acceleration can cause rendering issues on some devices with the MacOS.</Trans><br />
<Trans>You need to restart the app to activate the changes.</Trans>
</small>
</>
)}
</WizardLayout>
</div>
);