@@ -4,7 +4,12 @@ const { autoUpdater } = require('electron-updater');
44const { onFirstRunMaybe } = require ( './first-run' ) ;
55const path = require ( 'path' ) ;
66
7- const iconIdle = path . join ( __dirname , 'assets' , 'images' , 'tray-idleTemplate.png' ) ;
7+ const iconIdle = path . join (
8+ __dirname ,
9+ 'assets' ,
10+ 'images' ,
11+ 'tray-idleTemplate.png'
12+ ) ;
813const iconActive = path . join ( __dirname , 'assets' , 'images' , 'tray-active.png' ) ;
914
1015const browserWindowOpts = {
@@ -17,12 +22,20 @@ const browserWindowOpts = {
1722 enableRemoteModule : true ,
1823 overlayScrollbars : true ,
1924 nodeIntegration : true ,
25+ contextIsolation : false ,
2026 } ,
2127} ;
2228
29+ const delayedHideAppIcon = ( ) =>
30+ // Setting a timeout because the showDockIcon is not currently working
31+ // See more at https://github.com/maxogden/menubar/issues/306
32+ setTimeout ( ( ) => {
33+ app . dock . hide ( ) ;
34+ } , 1500 ) ;
35+
2336app . on ( 'ready' , async ( ) => {
2437 await onFirstRunMaybe ( ) ;
25- } )
38+ } ) ;
2639
2740const menubarApp = menubar ( {
2841 icon : iconIdle ,
@@ -32,6 +45,8 @@ const menubarApp = menubar({
3245} ) ;
3346
3447menubarApp . on ( 'ready' , ( ) => {
48+ delayedHideAppIcon ( ) ;
49+
3550 menubarApp . tray . setIgnoreDoubleClickEvents ( true ) ;
3651
3752 autoUpdater . checkForUpdatesAndNotify ( ) ;
0 commit comments