@@ -13,7 +13,7 @@ import { SplashServiceImpl } from '../splash/splash-service-impl';
13
13
@injectable ( )
14
14
export class ElectronMainApplication extends TheiaElectronMainApplication {
15
15
16
- protected windows : BrowserWindow [ ] = [ ] ;
16
+ protected _windows : BrowserWindow [ ] = [ ] ;
17
17
18
18
@inject ( SplashServiceImpl )
19
19
protected readonly splashService : SplashServiceImpl ;
@@ -34,7 +34,7 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
34
34
async createWindow ( asyncOptions : MaybePromise < TheiaBrowserWindowOptions > = this . getDefaultBrowserWindowOptions ( ) ) : Promise < BrowserWindow > {
35
35
const options = await asyncOptions ;
36
36
let electronWindow : BrowserWindow | undefined ;
37
- if ( this . windows . length ) {
37
+ if ( this . _windows . length ) {
38
38
electronWindow = new BrowserWindow ( options ) ;
39
39
} else {
40
40
const { bounds } = screen . getDisplayNearestPoint ( screen . getCursorScreenPoint ( ) ) ;
@@ -63,14 +63,14 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
63
63
splashScreenOpts
64
64
} , this . splashService . onCloseRequested ) ;
65
65
}
66
- this . windows . push ( electronWindow ) ;
66
+ this . _windows . push ( electronWindow ) ;
67
67
electronWindow . on ( 'closed' , ( ) => {
68
68
if ( electronWindow ) {
69
- const index = this . windows . indexOf ( electronWindow ) ;
69
+ const index = this . _windows . indexOf ( electronWindow ) ;
70
70
if ( index === - 1 ) {
71
71
console . warn ( `Could not dispose browser window: '${ electronWindow . title } '.` ) ;
72
72
} else {
73
- this . windows . splice ( index , 1 ) ;
73
+ this . _windows . splice ( index , 1 ) ;
74
74
electronWindow = undefined ;
75
75
}
76
76
}
@@ -148,4 +148,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
148
148
}
149
149
}
150
150
151
+ get windows ( ) : BrowserWindow [ ] {
152
+ return this . _windows . slice ( ) ;
153
+ }
154
+
151
155
}
0 commit comments