11process . env . ELECTRON_DISABLE_SECURITY_WARNINGS = "1" ;
22
3- const { app, BrowserWindow } = require ( "electron" ) ;
3+ const { app, screen , BrowserWindow } = require ( "electron" ) ;
44
55/**
66 * 自動生成ファイルの読み込み
@@ -12,9 +12,12 @@ app.commandLine.appendSwitch("disable-http-cache");
1212
1313const createWindow = ( ) =>
1414{
15+ const primaryDisplay = screen . getPrimaryDisplay ( ) ;
16+ const { width, height } = primaryDisplay . workAreaSize ;
17+
1518 const browserWindow = new BrowserWindow ( {
16- "fullscreen " : true ,
17- "autoHideMenuBar " : false ,
19+ "width " : width ,
20+ "height " : height ,
1821 "webPreferences" : {
1922 "nodeIntegration" : false
2023 }
@@ -28,26 +31,30 @@ const createWindow = () =>
2831 browserWindow . loadFile ( config . path ) ;
2932} ;
3033
31- app . whenReady ( ) . then ( createWindow ) ;
32-
33- app . on ( "window-all-closed" , ( ) =>
34- {
35- /**
36- * windowsならアプリを終了、macならdockに滞在
37- * Exit apps if windows, stay in dock if mac
38- */
39- if ( process . platform !== "darwin" ) {
40- app . quit ( ) ;
41- }
42- } ) ;
34+ app
35+ . whenReady ( )
36+ . then ( createWindow ) ;
37+
38+ app
39+ . on ( "window-all-closed" , ( ) =>
40+ {
41+ /**
42+ * windowsならアプリを終了、macならdockに滞在
43+ * Exit apps if windows, stay in dock if mac
44+ */
45+ if ( process . platform !== "darwin" ) {
46+ app . quit ( ) ;
47+ }
48+ } ) ;
4349
44- app . on ( "activate" , ( ) =>
45- {
46- /**
47- * アプリで起動している画面がなければアプリを起動
48- * If there is no screen running on the application, start the application.
49- */
50- if ( BrowserWindow . getAllWindows ( ) . length === 0 ) {
51- createWindow ( ) ;
52- }
53- } ) ;
50+ app
51+ . on ( "activate" , ( ) =>
52+ {
53+ /**
54+ * アプリで起動している画面がなければアプリを起動
55+ * If there is no screen running on the application, start the application.
56+ */
57+ if ( BrowserWindow . getAllWindows ( ) . length === 0 ) {
58+ createWindow ( ) ;
59+ }
60+ } ) ;
0 commit comments