Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Flow.Launcher.Infrastructure.DialogJump.Models;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
using NHotkey;

Check warning on line 12 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`NHotkey` is not a recognized word. (unrecognized-spelling)

Check warning on line 12 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`NHotkey` is not a recognized word. (unrecognized-spelling)

Check warning on line 12 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`NHotkey` is not a recognized word. (unrecognized-spelling)
using Windows.Win32;
using Windows.Win32.Foundation;
using Windows.Win32.UI.Accessibility;
Expand Down Expand Up @@ -153,27 +153,27 @@
// Unhook events
if (!_foregroundChangeHook.IsNull)
{
PInvoke.UnhookWinEvent(_foregroundChangeHook);

Check warning on line 156 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 156 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 156 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)
_foregroundChangeHook = HWINEVENTHOOK.Null;
}
if (!_locationChangeHook.IsNull)
{
PInvoke.UnhookWinEvent(_locationChangeHook);

Check warning on line 161 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 161 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 161 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)
_locationChangeHook = HWINEVENTHOOK.Null;
}
if (!_destroyChangeHook.IsNull)
{
PInvoke.UnhookWinEvent(_destroyChangeHook);

Check warning on line 166 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 166 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 166 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)
_destroyChangeHook = HWINEVENTHOOK.Null;
}
if (!_hideChangeHook.IsNull)
{
PInvoke.UnhookWinEvent(_hideChangeHook);

Check warning on line 171 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 171 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 171 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)
_hideChangeHook = HWINEVENTHOOK.Null;
}
if (!_dialogEndChangeHook.IsNull)
{
PInvoke.UnhookWinEvent(_dialogEndChangeHook);

Check warning on line 176 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 176 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)

Check warning on line 176 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`PInvoke` is not a recognized word. (unrecognized-spelling)
_dialogEndChangeHook = HWINEVENTHOOK.Null;
}

Expand Down Expand Up @@ -307,14 +307,14 @@
lock (_lastExplorerLock)
{
// Enum windows from the top to the bottom
PInvoke.EnumWindows((hWnd, _) =>

Check warning on line 310 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)

Check warning on line 310 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)
{
foreach (var explorer in _dialogJumpExplorers.Keys)
{
if (PublicApi.Instance.PluginModified(explorer.Metadata.ID) || // Plugin is modified
explorer.Metadata.Disabled) continue; // Plugin is disabled

var explorerWindow = explorer.Plugin.CheckExplorerWindow(hWnd);

Check warning on line 317 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)

Check warning on line 317 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)

Check warning on line 317 in Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)
if (explorerWindow != null)
{
_dialogJumpExplorers[explorer] = explorerWindow;
Expand Down Expand Up @@ -828,9 +828,25 @@
return true;
}
// file: URI paths
var localPath = path.StartsWith("file:", StringComparison.OrdinalIgnoreCase)
? new Uri(path).LocalPath
: path;
string localPath;
if (path.StartsWith("file:", StringComparison.OrdinalIgnoreCase))
{
// Try to create a URI from the path
if (Uri.TryCreate(path, UriKind.Absolute, out var uri))
{
localPath = uri.LocalPath;
}
else
{
// If URI creation fails, treat it as a regular path
// by removing the "file:" prefix
localPath = path.Substring(5);
}
}
else
{
localPath = path;
}
// Is folder?
var isFolder = Directory.Exists(localPath);
// Is file?
Expand Down
Loading