@@ -88,10 +88,10 @@ const onNewWindow = (event, url, frameName, disposition, options) => {
8888} ;
8989
9090/**
91- * Handle blur event on mainWindow
91+ * Handle show aot event.
9292 */
93- const onBlur = ( ) => {
94- logInfo ( 'handling main window blur ' ) ;
93+ const showAot = ( ) => {
94+ logInfo ( 'show aot handler ' ) ;
9595
9696 let state ;
9797
@@ -106,10 +106,10 @@ const onBlur = () => {
106106} ;
107107
108108/**
109- * Handle blur event on mainWindow
109+ * Handle hide aot event.
110110 */
111- const onFocus = ( ) => {
112- logInfo ( 'handling main window focus ' ) ;
111+ const hideAot = ( ) => {
112+ logInfo ( 'hide aot handler ' ) ;
113113
114114 hideWindow ( ) ;
115115} ;
@@ -129,8 +129,8 @@ const onClose = () => {
129129const addWindowHandlers = ( ) => {
130130 logInfo ( `adding main window event handlers` ) ;
131131
132- mainWindow . on ( 'blur' , onBlur ) ;
133- mainWindow . on ( 'focus' , onFocus ) ;
132+ mainWindow . on ( 'blur' , showAot ) ;
133+ mainWindow . on ( 'focus' , hideAot ) ;
134134
135135 // this might be redundant, since child windows will be closed anyway
136136 mainWindow . on ( 'close' , onClose ) ;
@@ -142,8 +142,8 @@ const addWindowHandlers = () => {
142142const removeWindowHandlers = ( ) => {
143143 logInfo ( `removing main window event handlers` ) ;
144144
145- mainWindow . removeListener ( 'blur' , onBlur ) ;
146- mainWindow . removeListener ( 'focus' , onFocus ) ;
145+ mainWindow . removeListener ( 'blur' , showAot ) ;
146+ mainWindow . removeListener ( 'focus' , hideAot ) ;
147147 mainWindow . removeListener ( 'close' , onClose ) ;
148148} ;
149149
@@ -194,6 +194,12 @@ const onStateChange = (event, { value }) => {
194194 // this will switch focus to main window, which in turns triggers hide on aot
195195 mainWindow . show ( ) ;
196196 break ;
197+ case STATES . SHOW_AOT_WINDOW :
198+ showAot ( ) ;
199+ break ;
200+ case STATES . HIDE_AOT_WINDOW :
201+ hideAot ( ) ;
202+ break ;
197203 default :
198204 break ;
199205 }
0 commit comments