Date: Mon, 14 Apr 2025 21:37:15 +1000
Subject: [PATCH 403/499] Add sponsor
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index cbb553bd1..d8ecfa671 100644
--- a/README.md
+++ b/README.md
@@ -351,6 +351,7 @@ Or download the [early access version](https://github.com/Flow-Launcher/Prerelea
+
From f8396892940ca99bb1e2c471408b1b4f18277969 Mon Sep 17 00:00:00 2001
From: DB p
Date: Tue, 15 Apr 2025 05:54:46 +0900
Subject: [PATCH 404/499] Add Content Dialog owner
---
Flow.Launcher/HotkeyControl.xaml.cs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs
index 8762a934b..9af3b71aa 100644
--- a/Flow.Launcher/HotkeyControl.xaml.cs
+++ b/Flow.Launcher/HotkeyControl.xaml.cs
@@ -243,6 +243,9 @@ namespace Flow.Launcher
}
var dialog = new HotkeyControlDialog(Hotkey, DefaultHotkey, WindowTitle);
+
+ dialog.Owner = Window.GetWindow(this);
+
await dialog.ShowAsync();
switch (dialog.ResultType)
{
From 9035aa6fab026722ef5ca71ebc3d55b0cfcfea69 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 15 Apr 2025 08:41:20 +0800
Subject: [PATCH 405/499] Fix dialog owner for all content dialog
---
Flow.Launcher/HotkeyControl.xaml.cs | 13 +++++++------
.../ViewModels/SettingsPanePluginsViewModel.cs | 3 +--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs
index 9af3b71aa..262727127 100644
--- a/Flow.Launcher/HotkeyControl.xaml.cs
+++ b/Flow.Launcher/HotkeyControl.xaml.cs
@@ -1,6 +1,4 @@
-#nullable enable
-
-using System.Collections.ObjectModel;
+using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
@@ -9,6 +7,8 @@ using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure.Hotkey;
using Flow.Launcher.Infrastructure.UserSettings;
+#nullable enable
+
namespace Flow.Launcher
{
public partial class HotkeyControl
@@ -242,9 +242,10 @@ namespace Flow.Launcher
HotKeyMapper.RemoveHotkey(Hotkey);
}
- var dialog = new HotkeyControlDialog(Hotkey, DefaultHotkey, WindowTitle);
-
- dialog.Owner = Window.GetWindow(this);
+ var dialog = new HotkeyControlDialog(Hotkey, DefaultHotkey, WindowTitle)
+ {
+ Owner = Window.GetWindow(this)
+ };
await dialog.ShowAsync();
switch (dialog.ResultType)
diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs
index b89e970e9..916fd1ece 100644
--- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs
+++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs
@@ -5,7 +5,6 @@ using System.Windows.Controls;
using System.Windows;
using CommunityToolkit.Mvvm.Input;
using Flow.Launcher.Core.Plugin;
-using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
using Flow.Launcher.ViewModel;
@@ -116,6 +115,7 @@ public partial class SettingsPanePluginsViewModel : BaseModel
{
var helpDialog = new ContentDialog()
{
+ Owner = Application.Current.MainWindow,
Content = new StackPanel
{
Children =
@@ -146,7 +146,6 @@ public partial class SettingsPanePluginsViewModel : BaseModel
}
}
},
-
PrimaryButtonText = (string)Application.Current.Resources["commonOK"],
CornerRadius = new CornerRadius(8),
Style = (Style)Application.Current.Resources["ContentDialog"]
From 28c7538fc3b00bc88a62336bba79d04a0b841fc3 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 15 Apr 2025 09:06:31 +0800
Subject: [PATCH 406/499] Fix possible Win32Exception
---
Flow.Launcher.Infrastructure/Win32Helper.cs | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs
index 6be024389..798501ae3 100644
--- a/Flow.Launcher.Infrastructure/Win32Helper.cs
+++ b/Flow.Launcher.Infrastructure/Win32Helper.cs
@@ -365,21 +365,10 @@ namespace Flow.Launcher.Infrastructure
// No installed English layout found
if (enHKL == HKL.Null) return;
- // When application is exiting, the Application.Current will be null
- if (Application.Current == null) return;
-
- // Get the FL main window
- var hwnd = GetWindowHandle(Application.Current.MainWindow, true);
+ // Get the foreground window
+ var hwnd = PInvoke.GetForegroundWindow();
if (hwnd == HWND.Null) return;
- // Check if the FL main window is the current foreground window
- if (!IsForegroundWindow(hwnd))
- {
- var result = PInvoke.SetForegroundWindow(hwnd);
- // If we cannot set the foreground window, we can use the foreground window and switch the layout
- if (!result) hwnd = PInvoke.GetForegroundWindow();
- }
-
// Get the current foreground window thread ID
var threadId = PInvoke.GetWindowThreadProcessId(hwnd);
if (threadId == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
From d21ffce47af56b25bbf14e36d7b475ce3e7f4689 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 15 Apr 2025 12:21:56 +0800
Subject: [PATCH 407/499] Use get window to get owner
---
.../SettingPages/ViewModels/SettingsPanePluginsViewModel.cs | 4 ++--
Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs
index 916fd1ece..de7cf15c3 100644
--- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs
+++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs
@@ -111,11 +111,11 @@ public partial class SettingsPanePluginsViewModel : BaseModel
.ToList();
[RelayCommand]
- private async Task OpenHelperAsync()
+ private async Task OpenHelperAsync(Button button)
{
var helpDialog = new ContentDialog()
{
- Owner = Application.Current.MainWindow,
+ Owner = Window.GetWindow(button),
Content = new StackPanel
{
Children =
diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml
index f9f708314..f3d630306 100644
--- a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml
+++ b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml
@@ -57,6 +57,7 @@
Height="34"
Margin="0 0 20 0"
Command="{Binding OpenHelperCommand}"
+ CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
Content=""
FontFamily="{DynamicResource SymbolThemeFontFamily}"
FontSize="14" />
From c382732f974d99211b4d739340f6fcd7fa3cedc9 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 15 Apr 2025 12:49:09 +0800
Subject: [PATCH 408/499] Improve windows exiting
---
Plugins/Flow.Launcher.Plugin.Sys/Main.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
index 043eb7a19..39bf49654 100644
--- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
@@ -362,6 +362,7 @@ namespace Flow.Launcher.Plugin.Sys
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe89f"),
Action = c =>
{
+ _context.API.HideMainWindow();
Application.Current.MainWindow.Close();
return true;
}
From 8e51096ba9ded910e3c2c2906404e5bc5f247701 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 15 Apr 2025 12:51:38 +0800
Subject: [PATCH 409/499] Improve log messages
---
Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs
index a49385a02..86df01a30 100644
--- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs
+++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs
@@ -171,8 +171,8 @@ namespace Flow.Launcher.Infrastructure.Image
}
catch (System.Exception e2)
{
- Log.Exception(ClassName, $"|ImageLoader.Load|Failed to get thumbnail for {path} on first try", e);
- Log.Exception(ClassName, $"|ImageLoader.Load|Failed to get thumbnail for {path} on second try", e2);
+ Log.Exception(ClassName, $"Failed to get thumbnail for {path} on first try", e);
+ Log.Exception(ClassName, $"Failed to get thumbnail for {path} on second try", e2);
ImageSource image = ImageCache[Constant.MissingImgIcon, false];
ImageCache[path, false] = image;
From a1b5941039da7370ee3c69d2c90ec61d7859ce35 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 15 Apr 2025 12:52:09 +0800
Subject: [PATCH 410/499] Improve WindowsThumbnailProvider
---
.../Image/ThumbnailReader.cs | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs b/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs
index b98ea50fe..fe389a331 100644
--- a/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs
+++ b/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs
@@ -12,7 +12,7 @@ using Windows.Win32.Graphics.Gdi;
namespace Flow.Launcher.Infrastructure.Image
{
///
- /// Subclass of
+ /// Subclass of
///
[Flags]
public enum ThumbnailOptions
@@ -33,6 +33,8 @@ namespace Flow.Launcher.Infrastructure.Image
private static readonly HRESULT S_ExtractionFailed = (HRESULT)0x8004B200;
+ private static readonly HRESULT S_PATHNOTFOUND = (HRESULT)0x8004B205;
+
public static BitmapSource GetThumbnail(string fileName, int width, int height, ThumbnailOptions options)
{
HBITMAP hBitmap = GetHBitmap(Path.GetFullPath(fileName), width, height, options);
@@ -79,9 +81,10 @@ namespace Flow.Launcher.Infrastructure.Image
{
imageFactory.GetImage(size, (SIIGBF)options, &hBitmap);
}
- catch (COMException ex) when (ex.HResult == S_ExtractionFailed && options == ThumbnailOptions.ThumbnailOnly)
+ catch (COMException ex) when (options == ThumbnailOptions.ThumbnailOnly &&
+ (ex.HResult == S_PATHNOTFOUND || ex.HResult == S_ExtractionFailed))
{
- // Fallback to IconOnly if ThumbnailOnly fails
+ // Fallback to IconOnly if extraction fails or files cannot be found
imageFactory.GetImage(size, (SIIGBF)ThumbnailOptions.IconOnly, &hBitmap);
}
catch (FileNotFoundException) when (options == ThumbnailOptions.ThumbnailOnly)
@@ -89,6 +92,11 @@ namespace Flow.Launcher.Infrastructure.Image
// Fallback to IconOnly if files cannot be found
imageFactory.GetImage(size, (SIIGBF)ThumbnailOptions.IconOnly, &hBitmap);
}
+ catch (System.Exception ex)
+ {
+ // Handle other exceptions
+ throw new InvalidOperationException("Failed to get thumbnail", ex);
+ }
}
finally
{
From 83fa654e2733ef28af1bef3d4f85ac607b1000b9 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 15 Apr 2025 12:59:58 +0800
Subject: [PATCH 411/499] Improve constant name
---
Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs b/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs
index fe389a331..4ce0df026 100644
--- a/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs
+++ b/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs
@@ -31,7 +31,7 @@ namespace Flow.Launcher.Infrastructure.Image
private static readonly Guid GUID_IShellItem = typeof(IShellItem).GUID;
- private static readonly HRESULT S_ExtractionFailed = (HRESULT)0x8004B200;
+ private static readonly HRESULT S_EXTRACTIONFAILED = (HRESULT)0x8004B200;
private static readonly HRESULT S_PATHNOTFOUND = (HRESULT)0x8004B205;
@@ -82,7 +82,7 @@ namespace Flow.Launcher.Infrastructure.Image
imageFactory.GetImage(size, (SIIGBF)options, &hBitmap);
}
catch (COMException ex) when (options == ThumbnailOptions.ThumbnailOnly &&
- (ex.HResult == S_PATHNOTFOUND || ex.HResult == S_ExtractionFailed))
+ (ex.HResult == S_PATHNOTFOUND || ex.HResult == S_EXTRACTIONFAILED))
{
// Fallback to IconOnly if extraction fails or files cannot be found
imageFactory.GetImage(size, (SIIGBF)ThumbnailOptions.IconOnly, &hBitmap);
From 81007f79aee6ca7671880afaa8e329e99bacb9f4 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 15 Apr 2025 13:18:06 +0800
Subject: [PATCH 412/499] Remove mvvm command for code quality
---
Flow.Launcher/ViewModel/RelayCommand.cs | 29 ----------
.../Flow.Launcher.Plugin.Explorer.csproj | 1 +
.../ViewModels/RelayCommand.cs | 27 ---------
.../ViewModels/SettingsViewModel.cs | 55 +++++++------------
.../Views/ExplorerSettings.xaml | 6 +-
5 files changed, 24 insertions(+), 94 deletions(-)
delete mode 100644 Flow.Launcher/ViewModel/RelayCommand.cs
delete mode 100644 Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/RelayCommand.cs
diff --git a/Flow.Launcher/ViewModel/RelayCommand.cs b/Flow.Launcher/ViewModel/RelayCommand.cs
deleted file mode 100644
index e8d4af8b5..000000000
--- a/Flow.Launcher/ViewModel/RelayCommand.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Windows.Input;
-
-namespace Flow.Launcher.ViewModel
-{
- public class RelayCommand : ICommand
- {
- private readonly Action