Skip to content

Commit 99f2b3b

Browse files
authored
Merge branch 'dev' into feature/4149-diacritics-insensitive-search
2 parents c2df52e + 6d8c35c commit 99f2b3b

20 files changed

Lines changed: 237 additions & 75 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v6
2424
- name: Set Flow.Launcher.csproj version
2525
id: update
26-
uses: vers-one/dotnet-project-version-updater@v1.7
26+
uses: vers-one/dotnet-project-version-updater@v1.8
2727
with:
2828
file: |
2929
"**/SolutionAssemblyInfo.cs"

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,6 @@ public bool ChangeTheme(string theme = null)
418418
if (string.IsNullOrEmpty(path))
419419
throw new DirectoryNotFoundException($"Theme path can't be found <{path}>");
420420

421-
// Retrieve theme resource – always use the resource with font settings applied.
422-
var resourceDict = GetResourceDictionary(theme);
423-
424-
UpdateResourceDictionary(resourceDict);
425-
426421
_settings.Theme = theme;
427422

428423
// Always allow re-loading default theme, in case of failure of switching to a new theme from default theme
@@ -432,7 +427,8 @@ public bool ChangeTheme(string theme = null)
432427
}
433428

434429
// Check if blur is enabled
435-
BlurEnabled = Win32Helper.IsBackdropSupported() && IsThemeBlurEnabled(resourceDict);
430+
var dict = GetThemeResourceDictionary(theme);
431+
BlurEnabled = Win32Helper.IsBackdropSupported() && IsThemeBlurEnabled(dict);
436432

437433
// Apply blur and drop shadow effect so that we do not need to call it again
438434
_ = RefreshFrameAsync();
@@ -706,30 +702,27 @@ private void SetBlurForWindow(string theme, BackdropTypes backdropType)
706702

707703
private void AutoDropShadow(bool useDropShadowEffect)
708704
{
709-
SetWindowCornerPreference("Default");
710-
RemoveDropShadowEffectFromCurrentTheme();
711705
if (useDropShadowEffect)
712706
{
713707
if (BlurEnabled && Win32Helper.IsBackdropSupported())
714708
{
709+
// For themes with blur enabled, the window border is rendered by the system,
710+
// so we set corner preference to round and remove drop shadow effect to avoid rendering issues.
715711
SetWindowCornerPreference("Round");
712+
RemoveDropShadowEffectFromCurrentTheme();
716713
}
717714
else
718715
{
716+
// For themes without blur, we set corner preference to default and add drop shadow effect.
719717
SetWindowCornerPreference("Default");
720718
AddDropShadowEffectToCurrentTheme();
721719
}
722720
}
723721
else
724722
{
725-
if (BlurEnabled && Win32Helper.IsBackdropSupported())
726-
{
727-
SetWindowCornerPreference("Default");
728-
}
729-
else
730-
{
731-
RemoveDropShadowEffectFromCurrentTheme();
732-
}
723+
// When drop shadow effect is disabled, we set corner preference to default and remove drop shadow effect.
724+
SetWindowCornerPreference("Default");
725+
RemoveDropShadowEffectFromCurrentTheme();
733726
}
734727
}
735728

Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<PackageReference Include="InputSimulator" Version="1.0.4" />
6767
<PackageReference Include="MemoryPack" Version="1.21.4" />
6868
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.14.15" />
69-
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.205">
69+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.269">
7070
<PrivateAssets>all</PrivateAssets>
7171
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
7272
</PackageReference>

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,10 +849,10 @@ public static unsafe void OpenFolderAndSelectFile(string filePath)
849849

850850
try
851851
{
852-
var hrFolder = PInvoke.SHParseDisplayName(folderPath, null, out pidlFolder, 0, null);
852+
var hrFolder = PInvoke.SHParseDisplayName(folderPath, null, out pidlFolder, 0, out _);
853853
if (hrFolder.Failed) throw new COMException("Failed to parse folder path", hrFolder);
854854

855-
var hrFile = PInvoke.SHParseDisplayName(filePath, null, out pidlFile, 0, null);
855+
var hrFile = PInvoke.SHParseDisplayName(filePath, null, out pidlFile, 0, out _);
856856
if (hrFile.Failed) throw new COMException("Failed to parse file path", hrFile);
857857

858858
var hrSelect = PInvoke.SHOpenFolderAndSelectItems(pidlFolder, 1, &pidlFile, 0);

Flow.Launcher.Infrastructure/packages.lock.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@
7070
},
7171
"Microsoft.Windows.CsWin32": {
7272
"type": "Direct",
73-
"requested": "[0.3.205, )",
74-
"resolved": "0.3.205",
75-
"contentHash": "U5wGAnyKd7/I2YMd43nogm81VMtjiKzZ9dsLMVI4eAB7jtv5IEj0gprj0q/F3iRmAIaGv5omOf8iSYx2+nE6BQ==",
73+
"requested": "[0.3.269, )",
74+
"resolved": "0.3.269",
75+
"contentHash": "O4GVJ0ymxcoFRGS07VcoEClj7A9PIciHIjWDrPymzonhYlOfM7V0ZqGBUK19cUH3BPca9MfSOH0KLK/9JzQ8+Q==",
7676
"dependencies": {
7777
"Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha",
78-
"Microsoft.Windows.SDK.Win32Metadata": "61.0.15-preview",
79-
"Microsoft.Windows.WDK.Win32Metadata": "0.12.8-experimental"
78+
"Microsoft.Windows.SDK.Win32Metadata": "69.0.7-preview",
79+
"Microsoft.Windows.WDK.Win32Metadata": "0.13.25-experimental"
8080
}
8181
},
8282
"NHotkey.Wpf": {
@@ -178,15 +178,15 @@
178178
},
179179
"Microsoft.Windows.SDK.Win32Metadata": {
180180
"type": "Transitive",
181-
"resolved": "61.0.15-preview",
182-
"contentHash": "cysex3dazKtCPALCluC2XX3f5Aedy9H2pw5jb+TW5uas2rkem1Z7FRnbUrg2vKx0pk0Qz+4EJNr37HdYTEcvEQ=="
181+
"resolved": "69.0.7-preview",
182+
"contentHash": "RJoNjQJVCIDNLPbvYuaygCFknTyAxOUE45of1voj0jjOgJa9MB2m1/G8L8F3IYc+2EFG5aqa/9y8PEx7Tk2tLQ=="
183183
},
184184
"Microsoft.Windows.WDK.Win32Metadata": {
185185
"type": "Transitive",
186-
"resolved": "0.12.8-experimental",
187-
"contentHash": "3n8R44/Z96Ly+ty4eYVJfESqbzvpw96lRLs3zOzyDmr1x1Kw7FNn5CyE416q+bZQV3e1HRuMUvyegMeRE/WedA==",
186+
"resolved": "0.13.25-experimental",
187+
"contentHash": "IM50tb/+UIwBr9FMr6ZKcZjCMW+Axo6NjGqKxgjUfyCY8dRnYUfrJEXxAaXoWtYP4X8EmASmC1Jtwh4XucseZg==",
188188
"dependencies": {
189-
"Microsoft.Windows.SDK.Win32Metadata": "61.0.15-preview"
189+
"Microsoft.Windows.SDK.Win32Metadata": "63.0.31-preview"
190190
}
191191
},
192192
"NHotkey": {

Flow.Launcher.Test/Plugins/ExplorerTest.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,5 +438,49 @@ public void GivenPath_WhenHavingEnvironmentVariableOrNot_ThenShouldBeExpected(st
438438
// Then
439439
ClassicAssert.AreEqual(result, expectedResult);
440440
}
441+
442+
[Test]
443+
public void GivenNonHomeFolderPaths_WhenCheckedWithIsHomeFolderPath_ThenShouldReturnFalse()
444+
{
445+
// Given
446+
var nonHomeFolders = new[]
447+
{
448+
@"C:\SomeRandomFolder",
449+
@"C:\Windows\System32",
450+
@"C:\Program Files",
451+
};
452+
453+
// When, Then
454+
foreach (var folder in nonHomeFolders)
455+
{
456+
ClassicAssert.IsFalse(ResultManager.IsHomeFolderPath(folder),
457+
$"Expected '{folder}' to NOT be recognized as a home folder");
458+
}
459+
}
460+
461+
[Test]
462+
public void GivenPathsInsideHomeDirectories_WhenCheckedWithIsHomeFolderPath_ThenShouldReturnTrue()
463+
{
464+
var desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
465+
466+
if (string.IsNullOrEmpty(desktopPath))
467+
{
468+
Assert.Ignore("Desktop special folder path is unavailable in this environment.");
469+
}
470+
471+
var homeFolderVariants = new[]
472+
{
473+
Path.Combine(desktopPath, "dummy_desktop_file"),
474+
Path.Combine(desktopPath, "dummy_desktop_folder") + "\\\\",
475+
desktopPath + "\\\\dummy_desktop_folder\\\\",
476+
Path.Combine(desktopPath, "dummy_desktop_folder", "dummy_desktop_file"),
477+
};
478+
479+
foreach (var path in homeFolderVariants)
480+
{
481+
ClassicAssert.IsTrue(ResultManager.IsHomeFolderPath(path),
482+
$"Expected '{path}' to be recognized as inside a home folder");
483+
}
484+
}
441485
}
442486
}

Flow.Launcher/MessageBoxEx.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
MaxWidth="400"
8989
Margin="0 0 26 0"
9090
VerticalAlignment="Center"
91-
FontFamily="Segoe UI"
9291
FontSize="20"
9392
FontWeight="SemiBold"
9493
TextAlignment="Left"

Flow.Launcher/ProgressBoxEx.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
MaxWidth="400"
9696
Margin="0 0 26 12"
9797
VerticalAlignment="Center"
98-
FontFamily="Segoe UI"
9998
FontSize="20"
10099
FontWeight="SemiBold"
101100
TextAlignment="Left"

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,11 @@ private async Task OpenResultAsync(string index)
515515
return;
516516
}
517517

518+
var hideWindow = false;
519+
var isDialogJumpLeftClick = _isDialogJump && Settings.DialogJumpResultBehaviour == DialogJumpResultBehaviours.LeftClick;
520+
518521
// For Dialog Jump and left click mode, we need to navigate to the path
519-
if (_isDialogJump && Settings.DialogJumpResultBehaviour == DialogJumpResultBehaviours.LeftClick)
522+
if (isDialogJumpLeftClick)
520523
{
521524
if (result is DialogJumpResult dialogJumpResult)
522525
{
@@ -531,26 +534,30 @@ private async Task OpenResultAsync(string index)
531534
// For query mode, we execute the result
532535
else
533536
{
534-
var hideWindow = await result.ExecuteAsync(new ActionContext
537+
hideWindow = await result.ExecuteAsync(new ActionContext
535538
{
536539
// not null means pressing modifier key + number, should ignore the modifier key
537540
SpecialKeyState = index is not null ? SpecialKeyState.Default : GlobalHotkey.CheckModifiers()
538541
}).ConfigureAwait(false);
539-
540-
if (hideWindow)
541-
{
542-
Hide();
543-
}
544542
}
545543

546-
// Record user selected result for result ranking
547-
_userSelectedRecord.Add(result);
548-
// Add item to history only if it is from results but not context menu or history
544+
// New history result must be recorded before Hide() is called, otherwise when in 'Empty Last Query' query style mode
545+
// the QueryAsync call will reconstruct the result list without the new item.
546+
// Also, add item to history only if it is from results but not context menu or history.
549547
if (queryResultsSelected)
550548
{
551549
_history.Add(result);
552550
lastHistoryIndex = 1;
553551
}
552+
553+
// Only hide for query results (not Dialog Jump left-click mode)
554+
if (!isDialogJumpLeftClick && hideWindow)
555+
{
556+
Hide();
557+
}
558+
559+
// Record user selected result for result ranking
560+
_userSelectedRecord.Add(result);
554561
}
555562

556563
private static IReadOnlyList<Result> DeepCloneResults(IReadOnlyList<Result> results, bool isDialogJump, CancellationToken token = default)

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
111111
<PackageReference Include="Flow.Launcher.Localization" Version="0.0.6" />
112112
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.5" />
113-
<PackageReference Include="Svg.Skia" Version="3.6.0" />
113+
<PackageReference Include="Svg.Skia" Version="3.7.0" />
114114
<PackageReference Include="SkiaSharp" Version="3.119.1" />
115115
</ItemGroup>
116116

0 commit comments

Comments
 (0)