Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Commit

Permalink
fix: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sentialx committed Mar 30, 2019
1 parent 578b9ba commit 9d6b250
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/main/app-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,13 @@ export class AppWindow extends BrowserWindow {
public draggedWindow: ProcessWindow;

public draggedIn = false;

public lastBounds: any;

public detached = false;

public isMoving = false;

public isUpdatingContentBounds = false;
public willAttachWindow = false;

public interval: any;

public willAttachWindow = false;

constructor() {
super({
frame: process.env.ENV === 'dev' || platform() === 'darwin',
Expand Down Expand Up @@ -137,8 +131,6 @@ export class AppWindow extends BrowserWindow {
this.draggedWindow = null;
return;
}

this.lastBounds = this.draggedWindow.getBounds();
}, 50);
});

Expand Down Expand Up @@ -197,7 +189,6 @@ export class AppWindow extends BrowserWindow {
}

this.draggedWindow = null;
this.lastBounds = null;
this.detached = false;
});
}
Expand Down Expand Up @@ -246,6 +237,7 @@ export class AppWindow extends BrowserWindow {
!this.windows.find(x => x.handle === this.draggedWindow.handle)
) {
const winBounds = this.draggedWindow.getBounds();
const { lastBounds } = this.draggedWindow;
const contentBounds = this.getContentArea();
const cursor = windowManager.getMousePoint();

Expand All @@ -260,8 +252,7 @@ export class AppWindow extends BrowserWindow {
if (
!this.detached &&
containsPoint(contentBounds, cursor) &&
this.lastBounds &&
(winBounds.x !== this.lastBounds.x || winBounds.y !== this.lastBounds.y)
(winBounds.x !== lastBounds.x || winBounds.y !== lastBounds.y)
) {
if (!this.draggedIn) {
const title = this.draggedWindow.getTitle();
Expand Down

0 comments on commit 9d6b250

Please sign in to comment.