@@ -375,12 +375,13 @@ function hideMainWindow(): void {
375375 state . windowPosition = { x : bounds . x , y : bounds . y }
376376 state . windowSize = { width : bounds . width , height : bounds . height }
377377 state . mainWindow . setIgnoreMouseEvents ( true , { forward : true } )
378- state . mainWindow . setFocusable ( false )
378+ state . mainWindow . setAlwaysOnTop ( true , "floating" , 1 )
379+ state . mainWindow . setVisibleOnAllWorkspaces ( true , {
380+ visibleOnFullScreen : true
381+ } )
379382 state . mainWindow . setOpacity ( 0 )
380383 state . mainWindow . hide ( )
381384 state . isWindowVisible = false
382- // Ensure we don't steal focus when hiding
383- app . hide ( )
384385 }
385386}
386387
@@ -393,15 +394,15 @@ function showMainWindow(): void {
393394 } )
394395 }
395396 state . mainWindow . setIgnoreMouseEvents ( false )
396- state . mainWindow . setFocusable ( true )
397+ state . mainWindow . setAlwaysOnTop ( true , "floating" , 1 )
398+ state . mainWindow . setVisibleOnAllWorkspaces ( true , {
399+ visibleOnFullScreen : true
400+ } )
401+ state . mainWindow . setContentProtection ( true )
397402 state . mainWindow . setOpacity ( 0 )
398- state . mainWindow . show ( )
399- state . mainWindow . setOpacity ( 1 )
400- // Use showInactive to prevent stealing focus
401403 state . mainWindow . showInactive ( )
404+ state . mainWindow . setOpacity ( 1 )
402405 state . isWindowVisible = true
403- // Ensure we don't activate the app
404- app . hide ( )
405406 }
406407}
407408
0 commit comments