aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-03-28 15:12:14 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-03-28 15:12:14 +0200
commit199f6763c946a044a28077cf8aa131f29af83868 (patch)
tree6743fae240e7b36cd68789267ca23877f3ac6f0a /src
parentmini cleanup (diff)
downloadferdium-app-199f6763c946a044a28077cf8aa131f29af83868.tar.gz
ferdium-app-199f6763c946a044a28077cf8aa131f29af83868.tar.zst
ferdium-app-199f6763c946a044a28077cf8aa131f29af83868.zip
feature(App): Add option to disable GPU acceleration
Diffstat (limited to 'src')
-rw-r--r--src/components/settings/settings/EditSettingsForm.js6
-rw-r--r--src/config.js1
-rw-r--r--src/containers/settings/EditSettingsScreen.js10
-rw-r--r--src/i18n/locales/en-US.json1
-rw-r--r--src/index.js8
5 files changed, 26 insertions, 0 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js
index 72aa5a8af..97f535594 100644
--- a/src/components/settings/settings/EditSettingsForm.js
+++ b/src/components/settings/settings/EditSettingsForm.js
@@ -76,6 +76,10 @@ const messages = defineMessages({
76 id: 'settings.app.currentVersion', 76 id: 'settings.app.currentVersion',
77 defaultMessage: '!!!Current version:', 77 defaultMessage: '!!!Current version:',
78 }, 78 },
79 enableGPUAccelerationInfo: {
80 id: 'settings.app.restartRequired',
81 defaultMessage: '!!!Changes require restart',
82 },
79}); 83});
80 84
81@observer 85@observer
@@ -172,6 +176,8 @@ export default class EditSettingsForm extends Component {
172 {/* Advanced */} 176 {/* Advanced */}
173 <h2 id="advanced">{intl.formatMessage(messages.headlineAdvanced)}</h2> 177 <h2 id="advanced">{intl.formatMessage(messages.headlineAdvanced)}</h2>
174 <Toggle field={form.$('enableSpellchecking')} /> 178 <Toggle field={form.$('enableSpellchecking')} />
179 <Toggle field={form.$('enableGPUAcceleration')} />
180 <p className="settings__help">{intl.formatMessage(messages.enableGPUAccelerationInfo)}</p>
175 {/* <Select field={form.$('spellcheckingLanguage')} /> */} 181 {/* <Select field={form.$('spellcheckingLanguage')} /> */}
176 <div className="settings__settings-group"> 182 <div className="settings__settings-group">
177 <h3> 183 <h3>
diff --git a/src/config.js b/src/config.js
index 8f6b85e1e..77fa92eca 100644
--- a/src/config.js
+++ b/src/config.js
@@ -21,6 +21,7 @@ export const DEFAULT_APP_SETTINGS = {
21 fallbackLocale: 'en-US', 21 fallbackLocale: 'en-US',
22 beta: false, 22 beta: false,
23 isAppMuted: false, 23 isAppMuted: false,
24 enableGPUAcceleration: true,
24}; 25};
25 26
26export const FRANZ_SERVICE_REQUEST = 'http://bit.ly/franz-service-request'; 27export const FRANZ_SERVICE_REQUEST = 'http://bit.ly/franz-service-request';
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js
index 1bd147099..018ce663f 100644
--- a/src/containers/settings/EditSettingsScreen.js
+++ b/src/containers/settings/EditSettingsScreen.js
@@ -51,6 +51,10 @@ const messages = defineMessages({
51 id: 'settings.app.form.enableSpellchecking', 51 id: 'settings.app.form.enableSpellchecking',
52 defaultMessage: '!!!Enable spell checking', 52 defaultMessage: '!!!Enable spell checking',
53 }, 53 },
54 enableGPUAcceleration: {
55 id: 'settings.app.form.enableGPUAcceleration',
56 defaultMessage: '!!!Enable GPU Acceleration',
57 },
54 spellcheckingLanguage: { 58 spellcheckingLanguage: {
55 id: 'settings.app.form.spellcheckingLanguage', 59 id: 'settings.app.form.spellcheckingLanguage',
56 defaultMessage: '!!!Language for spell checking', 60 defaultMessage: '!!!Language for spell checking',
@@ -85,6 +89,7 @@ export default class EditSettingsScreen extends Component {
85 runInBackground: settingsData.runInBackground, 89 runInBackground: settingsData.runInBackground,
86 enableSystemTray: settingsData.enableSystemTray, 90 enableSystemTray: settingsData.enableSystemTray,
87 minimizeToSystemTray: settingsData.minimizeToSystemTray, 91 minimizeToSystemTray: settingsData.minimizeToSystemTray,
92 enableGPUAcceleration: settingsData.enableGPUAcceleration,
88 showDisabledServices: settingsData.showDisabledServices, 93 showDisabledServices: settingsData.showDisabledServices,
89 showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, 94 showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted,
90 enableSpellchecking: settingsData.enableSpellchecking, 95 enableSpellchecking: settingsData.enableSpellchecking,
@@ -155,6 +160,11 @@ export default class EditSettingsScreen extends Component {
155 value: settings.all.app.enableSpellchecking, 160 value: settings.all.app.enableSpellchecking,
156 default: DEFAULT_APP_SETTINGS.enableSpellchecking, 161 default: DEFAULT_APP_SETTINGS.enableSpellchecking,
157 }, 162 },
163 enableGPUAcceleration: {
164 label: intl.formatMessage(messages.enableGPUAcceleration),
165 value: settings.all.app.enableGPUAcceleration,
166 default: DEFAULT_APP_SETTINGS.enableGPUAcceleration,
167 },
158 locale: { 168 locale: {
159 label: intl.formatMessage(messages.language), 169 label: intl.formatMessage(messages.language),
160 value: app.locale, 170 value: app.locale,
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json
index 400a9a5d8..0c62da44a 100644
--- a/src/i18n/locales/en-US.json
+++ b/src/i18n/locales/en-US.json
@@ -164,6 +164,7 @@
164 "settings.app.form.runInBackground": "Keep Franz in background when closing the window", 164 "settings.app.form.runInBackground": "Keep Franz in background when closing the window",
165 "settings.app.form.language": "Language", 165 "settings.app.form.language": "Language",
166 "settings.app.form.enableSpellchecking": "Enable spell checking", 166 "settings.app.form.enableSpellchecking": "Enable spell checking",
167 "settings.app.form.enableGPUAcceleration": "Enable GPU Acceleration",
167 "settings.app.form.showDisabledServices": "Display disabled services tabs", 168 "settings.app.form.showDisabledServices": "Display disabled services tabs",
168 "settings.app.form.showMessagesBadgesWhenMuted": "Show unread message badge when notifications are disabled", 169 "settings.app.form.showMessagesBadgesWhenMuted": "Show unread message badge when notifications are disabled",
169 "settings.app.form.beta": "Include beta versions", 170 "settings.app.form.beta": "Include beta versions",
diff --git a/src/index.js b/src/index.js
index 897943a85..5ba901b89 100644
--- a/src/index.js
+++ b/src/index.js
@@ -12,6 +12,8 @@ import handleDeepLink from './electron/deepLinking';
12import { appId } from './package.json'; // eslint-disable-line import/no-unresolved 12import { appId } from './package.json'; // eslint-disable-line import/no-unresolved
13import './electron/exception'; 13import './electron/exception';
14 14
15const debug = require('debug')('App');
16
15// Keep a global reference of the window object, if you don't, the window will 17// Keep a global reference of the window object, if you don't, the window will
16// be closed automatically when the JavaScript object is garbage collected. 18// be closed automatically when the JavaScript object is garbage collected.
17let mainWindow; 19let mainWindow;
@@ -57,6 +59,12 @@ if (isLinux && ['Pantheon', 'Unity:Unity7'].indexOf(process.env.XDG_CURRENT_DESK
57// Initialize Settings 59// Initialize Settings
58const settings = new Settings(); 60const settings = new Settings();
59 61
62// Disable GPU acceleration
63if (!settings.get('enableGPUAcceleration')) {
64 debug('Disable GPU Acceleration');
65 app.disableHardwareAcceleration();
66}
67
60const createWindow = () => { 68const createWindow = () => {
61 // Remember window size 69 // Remember window size
62 const mainWindowState = windowStateKeeper({ 70 const mainWindowState = windowStateKeeper({