@@ -154,11 +154,11 @@ public static void OnToggleHotkey(object sender, HotkeyEventArgs args)
154154 {
155155 if ( _isInitialized )
156156 {
157- NavigateDialogPath ( ) ;
157+ NavigateDialogPath ( Win32Helper . GetForegroundWindowHWND ( ) ) ;
158158 }
159159 }
160160
161- private static void NavigateDialogPath ( Action action = null )
161+ private static void NavigateDialogPath ( HWND dialog , Action action = null )
162162 {
163163 object document = null ;
164164 try
@@ -210,20 +210,19 @@ private static void NavigateDialogPath(Action action = null)
210210 return ;
211211 }
212212
213- Log . Debug ( ClassName , $ "Path: { path } ") ;
214- JumpToPath ( path , action ) ;
213+ JumpToPath ( dialog . Value , path , action ) ;
215214 }
216215
217216 [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Usage" , "VSTHRD101:Avoid unsupported async delegates" , Justification = "<Pending>" ) ]
218- public static void JumpToPath ( string path , Action action = null )
217+ public static void JumpToPath ( nint dialog , string path , Action action = null )
219218 {
220219 if ( ! CheckPath ( path , out var isFile ) ) return ;
221220
222221 var t = new Thread ( async ( ) =>
223222 {
224223 // Jump after flow launcher window vanished (after JumpAction returned true)
225224 // and the dialog had been in the foreground.
226- var timeOut = ! SpinWait . SpinUntil ( ( ) => GetWindowClassName ( PInvoke . GetForegroundWindow ( ) ) == DialogWindowClassName , 1000 ) ;
225+ var timeOut = ! SpinWait . SpinUntil ( ( ) => Win32Helper . GetForegroundWindow ( ) == dialog , 1000 ) ;
227226 if ( timeOut )
228227 {
229228 return ;
@@ -233,23 +232,25 @@ public static void JumpToPath(string path, Action action = null)
233232 await _navigationLock . WaitAsync ( ) ;
234233 try
235234 {
236- var dialog = Win32Helper . GetForegroundWindowHWND ( ) ;
235+ var dialogHandle = new HWND ( dialog ) ;
237236
238237 bool result ;
239238 if ( isFile )
240239 {
241- result = Win32Helper . FileJump ( path , dialog ) ;
240+ result = Win32Helper . FileJump ( path , dialogHandle ) ;
241+ Log . Debug ( ClassName , $ "File Jump: { path } ") ;
242242 }
243243 else
244244 {
245- result = Win32Helper . DirJump ( path , dialog ) ;
245+ result = Win32Helper . DirJump ( path , dialogHandle ) ;
246+ Log . Debug ( ClassName , $ "Dir Jump: { path } ") ;
246247 }
247248
248249 if ( result )
249250 {
250251 lock ( _autoSwitchedDialogsLock )
251252 {
252- _autoSwitchedDialogs . Add ( dialog ) ;
253+ _autoSwitchedDialogs . Add ( dialogHandle ) ;
253254 }
254255 }
255256 else
@@ -347,7 +348,7 @@ uint dwmsEventTime
347348 // Show quick switch window after navigating the path
348349 else
349350 {
350- NavigateDialogPath ( ( ) =>
351+ NavigateDialogPath ( hwnd , ( ) =>
351352 {
352353 if ( _settings . ShowQuickSwitchWindow )
353354 {
0 commit comments