Skip to content

Commit 23b586e

Browse files
committed
Improve log message
1 parent dc5b897 commit 23b586e

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

Flow.Launcher.Infrastructure/QuickSwitch/Models/WindowsExplorer.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Runtime.InteropServices;
3-
using Flow.Launcher.Infrastructure.Logger;
43
using Flow.Launcher.Infrastructure.QuickSwitch.Interface;
54
using Windows.Win32;
65
using Windows.Win32.Foundation;
@@ -37,8 +36,6 @@ public bool CheckExplorerWindow(HWND foreground)
3736

3837
_lastExplorerView = explorer;
3938
isExplorer = true;
40-
41-
Log.Debug(ClassName, $"{explorer.HWND.Value}");
4239
}
4340
catch (COMException)
4441
{

Flow.Launcher.Infrastructure/QuickSwitch/QuickSwitch.cs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)