diff --git a/newton/app.js b/newton/app.js index a8791c8..1bdf54e 100644 --- a/newton/app.js +++ b/newton/app.js @@ -34,12 +34,13 @@ const createWindow = (startType = "build", debug = false, args = []) => { icon: settingsManager.getIconPath(), webPreferences: { preload: path.join(__dirname, 'preload.js'), + backgroundThrottling: false, + webSecurity: true, + sandbox: true, nodeIntegration: false, contextIsolation: true, enableRemoteModule: false, plugins: true, - webSecurity: true, - sandbox: true, } }); diff --git a/newton/main.js b/newton/main.js index fd10026..77bed30 100644 --- a/newton/main.js +++ b/newton/main.js @@ -1,11 +1,17 @@ const { app, ipcMain } = require('electron'); +app.commandLine.appendSwitch('disable-renderer-backgrounding'); +app.commandLine.appendSwitch('disable-background-timer-throttling'); +app.commandLine.appendSwitch('disable-backgrounding-occluded-windows'); + const { newton } = require('./app'); + let window = null; + const loadHandlers = () => { ipcMain.handle('getLspConfigData', (eve) => newton.fs.getLspConfigData()); ipcMain.handle('getFileContents', (eve, path) => newton.fs.getFileContents(path)); diff --git a/src/app/editor/tabs/tabs.component.ts b/src/app/editor/tabs/tabs.component.ts index 93c8e99..4679c43 100644 --- a/src/app/editor/tabs/tabs.component.ts +++ b/src/app/editor/tabs/tabs.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, ChangeDetectorRef } from '@angular/core'; import { CommonModule } from '@angular/common'; import { CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop'; import { Subject, takeUntil } from 'rxjs'; @@ -34,7 +34,8 @@ export class TabsComponent { constructor( private editorsService: EditorsService, - private tabsService: TabsService + private tabsService: TabsService, + private changeDetectorRef: ChangeDetectorRef ) { } @@ -54,7 +55,8 @@ export class TabsComponent { } private createTab(title: string, uuid: string, path: string): void { - this.tabs.push({title: title, path: path, uuid: uuid}) + this.tabs.push({title: title, path: path, uuid: uuid}); + this.changeDetectorRef.detectChanges(); } handleAction(event: any): void {