[MM-22720] Assume maximize setting when AppleActionOnDoubleClick isn't explicitly set (#1214)

* [MM-22720] Assume maximize setting when AppleActionOnDoubleClick isn't explicitly set

* Forced for macOS only and made same changes to SettingsPage

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Devin Binnie
2020-04-07 14:52:33 -04:00
committed by GitHub
parent 93f7ae9b47
commit 9b5f53a294
2 changed files with 20 additions and 16 deletions

View File

@@ -547,16 +547,18 @@ export default class MainPage extends React.Component {
}
handleDoubleClick = () => {
if (process.platform === 'darwin') {
const doubleClickAction = remote.systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string');
const win = remote.getCurrentWindow();
if (doubleClickAction === 'Minimize') {
win.minimize();
} else if (doubleClickAction === 'Maximize' && !win.isMaximized()) {
} else if (!win.isMaximized()) {
win.maximize();
} else if (doubleClickAction === 'Maximize' && win.isMaximized()) {
} else if (win.isMaximized()) {
win.unmaximize();
}
}
}
addServer = () => {
this.setState({

View File

@@ -467,16 +467,18 @@ export default class SettingsPage extends React.Component {
}
handleDoubleClick = () => {
if (process.platform === 'darwin') {
const doubleClickAction = remote.systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string');
const win = remote.getCurrentWindow();
if (doubleClickAction === 'Minimize') {
win.minimize();
} else if (doubleClickAction === 'Maximize' && !win.isMaximized()) {
} else if (!win.isMaximized()) {
win.maximize();
} else if (doubleClickAction === 'Maximize' && win.isMaximized()) {
} else if (win.isMaximized()) {
win.unmaximize();
}
}
}
handleMaximizeState = () => {
const win = remote.getCurrentWindow();