5 Commits
Author SHA1 Message Date
ds5678 96c537b7e8 Bump version to 1.1.2
Updated VersionPrefix in Directory.Build.props from 1.1.1 to 1.1.2 to prepare for a new release. No other changes were made.
2026-02-17 14:55:49 -08:00
MrBub 505d4dc16d Fix: Make file/folder dialogs automatically come to foreground on Windows (#16) 2026-02-06 17:50:40 -08:00
ds5678 49e71fc0a5 Update readme 2026-01-26 19:27:01 -08:00
ds5678 0ca1fdb1dc Bump version to 1.1.1 in Directory.Build.props
Updated the VersionPrefix property from 1.1.0 to 1.1.1 to prepare for a new patch release. No other changes were made.
2026-01-26 19:24:47 -08:00
ds5678 63278e1a51 Check if bash is installed 2026-01-26 19:24:08 -08:00
6 changed files with 16 additions and 9 deletions

No files matched your search

+2 -2
View File
@@ -40,7 +40,7 @@ public static class OpenFileDialog
{
OPENFILENAMEW ofn = default;
ofn.lStructSize = (uint)Unsafe.SizeOf<OPENFILENAMEW>();
ofn.hwndOwner = default; // No owner window.
ofn.hwndOwner = Windows.GetConsoleWindow(); // Use console window as owner to ensure dialog comes to foreground
ofn.lpstrFile = bufferPtr;
ofn.nMaxFile = (uint)buffer.Length;
ofn.lpstrFilter = filterPtr;
@@ -119,7 +119,7 @@ public static class OpenFileDialog
{
OPENFILENAMEW ofn = default;
ofn.lStructSize = (uint)Unsafe.SizeOf<OPENFILENAMEW>();
ofn.hwndOwner = default; // No owner window.
ofn.hwndOwner = Windows.GetConsoleWindow(); // Use console window as owner to ensure dialog comes to foreground
ofn.lpstrFile = bufferPtr;
ofn.nMaxFile = (uint)buffer.Length;
ofn.lpstrFilter = filterPtr;
@@ -90,8 +90,9 @@ public static class OpenFolderDialog
pFileDialog->GetOptions(&dwOptions);
pFileDialog->SetOptions(dwOptions | (uint)FILEOPENDIALOGOPTIONS.FOS_PICKFOLDERS | (uint)FILEOPENDIALOGOPTIONS.FOS_FORCEFILESYSTEM);
// Show the dialog
hr = pFileDialog->Show(default);
// Show the dialog with console window as owner to ensure it comes to foreground
HWND hwndOwner = Windows.GetConsoleWindow();
hr = pFileDialog->Show(hwndOwner);
if (Windows.SUCCEEDED(hr))
{
IShellItem* pItem;
@@ -221,8 +222,9 @@ public static class OpenFolderDialog
string[]? result = null;
// Show the dialog
hr = pFileDialog->Show(default);
// Show the dialog with console window as owner to ensure it comes to foreground
HWND hwndOwner = Windows.GetConsoleWindow();
hr = pFileDialog->Show(hwndOwner);
if (Windows.SUCCEEDED(hr))
{
IShellItemArray* pItemArray;
@@ -61,6 +61,11 @@ internal static class ProcessExecutor
[SupportedOSPlatform("linux")]
public static async Task<bool> HasCommand(string command)
{
ArgumentException.ThrowIfNullOrEmpty(command);
if (!File.Exists("/bin/bash"))
{
return false;
}
string? result = await TryRun("/bin/bash", "-c", $"command -v {EscapeString(command)}");
return !string.IsNullOrEmpty(result);
}
+1 -1
View File
@@ -42,7 +42,7 @@ public static class SaveFileDialog
{
OPENFILENAMEW ofn = default;
ofn.lStructSize = (uint)Unsafe.SizeOf<OPENFILENAMEW>();
ofn.hwndOwner = default; // No owner window.
ofn.hwndOwner = Windows.GetConsoleWindow(); // Use console window as owner to ensure dialog comes to foreground
ofn.lpstrFile = bufferPtr;
ofn.nMaxFile = (uint)buffer.Length;
ofn.lpstrFilter = filterPtr;
+1 -1
View File
@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<VersionPrefix>1.1.0</VersionPrefix>
<VersionPrefix>1.1.2</VersionPrefix>
<Copyright>Copyright (c) 2026 ds5678</Copyright>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>
+1 -1
View File
@@ -6,7 +6,7 @@ A cross-platform library for picking files and folders in .NET applications.
On Windows, downstream projects must disable `CETCompat`. Leaving it enabled may cause crashes when opening native file dialogs.
Add the following to the consuming project’s `.csproj`:
Add the following to the consuming project `.csproj` file:
```xml
<PropertyGroup>