mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 10:28:05 +00:00
fixed crash when no window position is saved (fixes #1175)
This commit is contained in:
@@ -51,16 +51,18 @@ export class Window {
|
|||||||
show: false,
|
show: false,
|
||||||
backgroundColor: '#00000000'
|
backgroundColor: '#00000000'
|
||||||
}
|
}
|
||||||
Object.assign(bwOptions, this.windowBounds)
|
|
||||||
|
|
||||||
const closestDisplay = screen.getDisplayNearestPoint( {x: this.windowBounds.x, y: this.windowBounds.y} )
|
if (this.windowBounds) {
|
||||||
|
Object.assign(bwOptions, this.windowBounds)
|
||||||
|
const closestDisplay = screen.getDisplayNearestPoint( {x: this.windowBounds.x, y: this.windowBounds.y} )
|
||||||
|
|
||||||
const [left1, top1, right1, bottom1] = [this.windowBounds.x, this.windowBounds.y, this.windowBounds.x + this.windowBounds.width, this.windowBounds.y + this.windowBounds.height];
|
const [left1, top1, right1, bottom1] = [this.windowBounds.x, this.windowBounds.y, this.windowBounds.x + this.windowBounds.width, this.windowBounds.y + this.windowBounds.height];
|
||||||
const [left2, top2, right2, bottom2] = [closestDisplay.bounds.x, closestDisplay.bounds.y, closestDisplay.bounds.x + closestDisplay.bounds.width, closestDisplay.bounds.y + closestDisplay.bounds.height];
|
const [left2, top2, right2, bottom2] = [closestDisplay.bounds.x, closestDisplay.bounds.y, closestDisplay.bounds.x + closestDisplay.bounds.width, closestDisplay.bounds.y + closestDisplay.bounds.height];
|
||||||
|
|
||||||
if ((left2 > right1 || right2 < left1 || top2 > bottom1 || bottom2 < top1) && !maximized) {
|
if ((left2 > right1 || right2 < left1 || top2 > bottom1 || bottom2 < top1) && !maximized) {
|
||||||
bwOptions.x = closestDisplay.bounds.width / 2 - bwOptions.width / 2;
|
bwOptions.x = closestDisplay.bounds.width / 2 - bwOptions.width / 2;
|
||||||
bwOptions.y = closestDisplay.bounds.height / 2 - bwOptions.height / 2;
|
bwOptions.y = closestDisplay.bounds.height / 2 - bwOptions.height / 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((configData.appearance || {}).frame === 'native') {
|
if ((configData.appearance || {}).frame === 'native') {
|
||||||
|
Reference in New Issue
Block a user