Skip to content

Commit

Permalink
Fixes #2829: Update window dirty state asynchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Feb 17, 2016
1 parent 149e7a0 commit b8e7046
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,16 @@ export class FileTracker implements IWorkbenchContribution {

private updateDocumentEdited(): void {
if (plat.platform === plat.Platform.Mac) {
let win = remote.getCurrentWindow();
let isDirtyIndicated = win.isDocumentEdited();
let hasDirtyFiles = this.textFileService.isDirty();
this.isDocumentedEdited = hasDirtyFiles;

if (hasDirtyFiles !== isDirtyIndicated) {
win.setDocumentEdited(hasDirtyFiles);
}
process.nextTick(() => {
let win = remote.getCurrentWindow();
let isDirtyIndicated = win.isDocumentEdited();
let hasDirtyFiles = this.textFileService.isDirty();
this.isDocumentedEdited = hasDirtyFiles;

if (hasDirtyFiles !== isDirtyIndicated) {
win.setDocumentEdited(hasDirtyFiles);
}
});
}
}

Expand Down

0 comments on commit b8e7046

Please sign in to comment.