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

Commit

Permalink
Fix windows attaching
Browse files Browse the repository at this point in the history
  • Loading branch information
sentialx committed Feb 24, 2019
1 parent 94867dd commit 02daf32
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/app-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class AppWindow extends BrowserWindow {
public selectedWindow: ProcessWindow;

public lastBounds: any;

public detachedWindow: Window;

constructor() {
Expand Down Expand Up @@ -137,8 +138,12 @@ export class AppWindow extends BrowserWindow {
mouseEvents.on('mouse-down', () => {
if (this.isMinimized()) return;

const window = new ProcessWindow(windowManager.getActiveWindow().handle);
this.lastBounds = window.getBounds();
setTimeout(() => {
const window = new ProcessWindow(
windowManager.getActiveWindow().handle,
);
this.lastBounds = window.getBounds();
}, 50);
});

mouseEvents.on('mouse-up', async data => {
Expand Down Expand Up @@ -205,7 +210,6 @@ export class AppWindow extends BrowserWindow {

window.show();

this.lastBounds = null;
this.selectedWindow = window;

this.resizeWindow(window);
Expand Down

0 comments on commit 02daf32

Please sign in to comment.