@@ -171,10 +171,12 @@ electronRemote.app.on('second-instance', function(event, argv) {
171171 }
172172
173173 openComic ( arg , true ) ;
174- break ;
174+ return ;
175175 }
176176 }
177177
178+ openEmptyNewWindow ( ) ;
179+
178180} ) ;
179181
180182function registreOpenUrl ( )
@@ -351,6 +353,7 @@ electron.ipcRenderer.on('init-data', function(event, data) {
351353} ) ;
352354
353355let historyFromStartApp = false ;
356+ let emptyNewWindow = false ;
354357
355358async function loadFromHistory ( )
356359{
@@ -378,6 +381,7 @@ async function startApp()
378381
379382 const args = [ ...process . argv , ...electronRemote . process . argv ] ;
380383
384+ emptyNewWindow = args . includes ( '--empty-new-window' ) ;
381385 let toOpenFileMainPath = getArgValue ( args , '--main-path' , false ) ;
382386 toOpenFile = toOpenFile || getArgValue ( args , '--path' , false ) ;
383387
@@ -415,7 +419,7 @@ async function startApp()
415419
416420 let lastReading = false ;
417421
418- if ( config . startInContinueReading )
422+ if ( config . startInContinueReading && ! emptyNewWindow )
419423 {
420424 let readingProgress = relative . get ( 'readingProgress' ) ;
421425 let highest = 0 ;
@@ -480,7 +484,7 @@ async function startApp()
480484 }
481485 }
482486
483- if ( ! config . restoreTabsFromLastSession || ! tabs ?. tabs ?. length || ( tabs . tabs . length === 1 && ! config . showAlwaysTabsBar ) )
487+ if ( emptyNewWindow || ! config . restoreTabsFromLastSession || ! tabs ?. tabs ?. length || ( tabs . tabs . length === 1 && ! config . showAlwaysTabsBar ) )
484488 {
485489 if ( lastReading && fs . existsSync ( lastReading . mainPath ) )
486490 dom . openComic ( false , lastReading . path , lastReading . mainPath ) ;
@@ -582,6 +586,12 @@ async function openPathInNewWindow(path, mainPath = '', history = null, options
582586 return await openNewWindow ( [ '--path=' + path , '--new-window' , '--window-x=' + x , '--window-y=' + y , '--window-width=' + width , '--window-height=' + height , '--main-path=' + mainPath , '--init-history=true' ] , { initHistory : history , ...options } ) ;
583587}
584588
589+ async function openEmptyNewWindow ( )
590+ {
591+ const { x, y, width, height} = electronRemote . getCurrentWindow ( ) . getBounds ( ) ;
592+ return await openNewWindow ( [ '--empty-new-window' , '--new-window' , '--window-x=' + x , '--window-y=' + y , '--window-width=' + width , '--window-height=' + height ] , { } ) ;
593+ }
594+
585595function openPathInNewTab ( path , mainPath = '' )
586596{
587597 const tabId = tabs . openPath ( path , mainPath ) ;
0 commit comments