Add "Enable GPU hardware acceleration" option
This commit is contained in:
@@ -136,6 +136,7 @@ const SettingsPage = createReactClass({
|
||||
showUnreadBadge: this.state.showUnreadBadge,
|
||||
useSpellChecker: this.state.useSpellChecker,
|
||||
spellCheckerLocale: this.state.spellCheckerLocale,
|
||||
enableHardwareAcceleration: this.state.enableHardwareAcceleration,
|
||||
};
|
||||
|
||||
settings.writeFile(this.props.configFile, config, (err) => {
|
||||
@@ -259,6 +260,13 @@ const SettingsPage = createReactClass({
|
||||
setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS);
|
||||
},
|
||||
|
||||
handleChangeEnableHardwareAcceleration() {
|
||||
this.setState({
|
||||
enableHardwareAcceleration: !this.refs.enableHardwareAcceleration.props.checked,
|
||||
});
|
||||
setImmediate(this.startSaveConfig, CONFIG_TYPE_APP_OPTIONS);
|
||||
},
|
||||
|
||||
updateTeam(index, newData) {
|
||||
var teams = this.state.teams;
|
||||
teams[index] = newData;
|
||||
@@ -549,6 +557,23 @@ const SettingsPage = createReactClass({
|
||||
</Checkbox>);
|
||||
}
|
||||
|
||||
options.push(
|
||||
<Checkbox
|
||||
key='inputEnableHardwareAcceleration'
|
||||
id='inputEnableHardwareAcceleration'
|
||||
ref='enableHardwareAcceleration'
|
||||
checked={this.state.enableHardwareAcceleration}
|
||||
onChange={this.handleChangeEnableHardwareAcceleration}
|
||||
>
|
||||
{'Use GPU hardware acceleration'}
|
||||
<HelpBlock>
|
||||
{'Disable this setting if you see a blank page after logging in to Mattermost.'}
|
||||
{' If enabled, the Mattermost UI is rendered more efficiently but can cause stability issues for some systems.'}
|
||||
{' Setting takes affect after restarting the app.'}
|
||||
</HelpBlock>
|
||||
</Checkbox>
|
||||
);
|
||||
|
||||
var optionsRow = (options.length > 0) ? (
|
||||
<Row>
|
||||
<Col md={12}>
|
||||
|
@@ -15,6 +15,7 @@ const defaultPreferences = {
|
||||
},
|
||||
showUnreadBadge: true,
|
||||
useSpellChecker: true,
|
||||
enableHardwareAcceleration: true,
|
||||
};
|
||||
|
||||
module.exports = defaultPreferences;
|
||||
|
@@ -88,6 +88,10 @@ try {
|
||||
settings.writeFileSync(configFile, config);
|
||||
}
|
||||
}
|
||||
if (config.enableHardwareAcceleration === false) {
|
||||
app.disableHardwareAcceleration();
|
||||
}
|
||||
|
||||
ipcMain.on('update-config', () => {
|
||||
const configFile = app.getPath('userData') + '/config.json';
|
||||
config = settings.readFileSync(configFile);
|
||||
|
Reference in New Issue
Block a user