mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
Fallback to getPrimaryDisplay() if getDisplayMatching() returns null
This commit is contained in:
parent
7159b127e2
commit
d0a91bea80
1 changed files with 3 additions and 3 deletions
|
@ -587,9 +587,9 @@ export default class AppEnvConstructor {
|
||||||
center() {
|
center() {
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
let dimensions = this.getWindowDimensions();
|
let dimensions = this.getWindowDimensions();
|
||||||
let bounds = remote.screen.getDisplayMatching(dimensions).bounds;
|
let display = remote.screen.getDisplayMatching(dimensions) || remote.screen.getPrimaryDisplay();
|
||||||
let x = bounds.x + ((bounds.width - dimensions.width) / 2);
|
let x = display.bounds.x + ((display.bounds.width - dimensions.width) / 2);
|
||||||
let y = bounds.y + ((bounds.height - dimensions.height) / 2);
|
let y = display.bounds.y + ((display.bounds.height - dimensions.height) / 2);
|
||||||
|
|
||||||
return this.setPosition(x, y);
|
return this.setPosition(x, y);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue