@@ -113,8 +113,14 @@ public static void SetupQuickSwitch(bool enabled)
113113 // Use HWND.Null here because we want to check all windows
114114 if ( explorer . CheckExplorerWindow ( HWND . Null ) )
115115 {
116- // Set last explorer view if not set, this is beacuse default WindowsExplorer is the first element
117- _lastExplorer ??= explorer ;
116+ if ( _lastExplorer == null )
117+ {
118+ Log . Debug ( ClassName , $ "Explorer window") ;
119+ // Set last explorer view if not set,
120+ // this is beacuse default WindowsExplorer is the first element
121+ _lastExplorer = explorer ;
122+ break ;
123+ }
118124 }
119125 }
120126 }
@@ -403,6 +409,7 @@ uint dwmsEventTime
403409 {
404410 if ( explorer . CheckExplorerWindow ( hwnd ) )
405411 {
412+ Log . Debug ( ClassName , $ "Explorer window: { hwnd } ") ;
406413 _lastExplorer = explorer ;
407414 break ;
408415 }
@@ -474,7 +481,7 @@ uint dwmsEventTime
474481 // If the dialog window is destroyed, set _dialogWindowHandle to null
475482 if ( _dialogWindow != null && _dialogWindow . Handle == hwnd )
476483 {
477- Log . Debug ( ClassName , $ "Dialog Hwnd : { hwnd } ") ;
484+ Log . Debug ( ClassName , $ "Destory dialog : { hwnd } ") ;
478485 lock ( _dialogWindowLock )
479486 {
480487 _dialogWindow = null ;
@@ -525,20 +532,20 @@ public static void JumpToPath(nint dialog, string path, Action action = null)
525532 switch ( _settings . QuickSwitchFileResultBehaviour )
526533 {
527534 case QuickSwitchFileResultBehaviours . FullPath :
528- result = FileJump ( path , dialogHandle , forceFileName : true ) ;
529535 Log . Debug ( ClassName , $ "File Jump FullPath: { path } ") ;
536+ result = FileJump ( path , dialogHandle , forceFileName : true ) ;
530537 break ;
531538 case QuickSwitchFileResultBehaviours . FullPathOpen :
532- result = FileJump ( path , dialogHandle , forceFileName : true , openFile : true ) ;
533539 Log . Debug ( ClassName , $ "File Jump FullPathOpen: { path } ") ;
540+ result = FileJump ( path , dialogHandle , forceFileName : true , openFile : true ) ;
534541 break ;
535542 case QuickSwitchFileResultBehaviours . Directory :
536- result = DirJump ( Path . GetDirectoryName ( path ) , dialogHandle ) ;
537543 Log . Debug ( ClassName , $ "File Jump Directory: { path } ") ;
544+ result = DirJump ( Path . GetDirectoryName ( path ) , dialogHandle ) ;
538545 break ;
539546 case QuickSwitchFileResultBehaviours . DirectoryAndFileName :
540- result = FileJump ( path , dialogHandle ) ;
541547 Log . Debug ( ClassName , $ "File Jump DirectoryAndFileName: { path } ") ;
548+ result = FileJump ( path , dialogHandle ) ;
542549 break ;
543550 default :
544551 throw new ArgumentOutOfRangeException (
@@ -550,8 +557,8 @@ public static void JumpToPath(nint dialog, string path, Action action = null)
550557 }
551558 else
552559 {
553- result = DirJump ( path , dialogHandle ) ;
554560 Log . Debug ( ClassName , $ "Dir Jump: { path } ") ;
561+ result = DirJump ( path , dialogHandle ) ;
555562 }
556563
557564 if ( result )
0 commit comments