From 8637c03bda281585a77132485eb10ae15bc3681f Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Fri, 28 Apr 2023 11:27:26 +0800 Subject: [PATCH 1/4] Fallback to legacy for windows 22621 --- Flow.Launcher/Notification.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher/Notification.cs b/Flow.Launcher/Notification.cs index 64db5c213..d858e5313 100644 --- a/Flow.Launcher/Notification.cs +++ b/Flow.Launcher/Notification.cs @@ -57,6 +57,7 @@ namespace Flow.Launcher Log.Exception("Flow.Launcher.Notification|Notification InvalidOperationException Error", e); if (Environment.OSVersion.Version.Build >= 22621) { + LegacyShow(title, subTitle, iconPath); return; } else From c251a276a70d6dbe53e6e9bc8a1a18be6ae2f963 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Fri, 28 Apr 2023 11:55:32 +0800 Subject: [PATCH 2/4] Test legacy show on win 11 --- Flow.Launcher/Notification.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Flow.Launcher/Notification.cs b/Flow.Launcher/Notification.cs index d858e5313..151d65ce4 100644 --- a/Flow.Launcher/Notification.cs +++ b/Flow.Launcher/Notification.cs @@ -36,6 +36,14 @@ namespace Flow.Launcher LegacyShow(title, subTitle, iconPath); return; } + + // Test LegacyShow() usability on win 11 22621 + // REMOVE BEFORE MERGING + if (Environment.OSVersion.Version.Build >= 22621) + { + LegacyShow(title, subTitle, iconPath); + return; + } // Using Windows Notification System var Icon = !File.Exists(iconPath) From 85a077f430953f3fe9d4fa3057bf3835b9af7652 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Fri, 28 Apr 2023 13:52:16 +0800 Subject: [PATCH 3/4] Delete test code --- Flow.Launcher/Notification.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Flow.Launcher/Notification.cs b/Flow.Launcher/Notification.cs index 151d65ce4..d858e5313 100644 --- a/Flow.Launcher/Notification.cs +++ b/Flow.Launcher/Notification.cs @@ -36,14 +36,6 @@ namespace Flow.Launcher LegacyShow(title, subTitle, iconPath); return; } - - // Test LegacyShow() usability on win 11 22621 - // REMOVE BEFORE MERGING - if (Environment.OSVersion.Version.Build >= 22621) - { - LegacyShow(title, subTitle, iconPath); - return; - } // Using Windows Notification System var Icon = !File.Exists(iconPath) From dee74b842f7991f987e945f03e75c69c5e0124dd Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:53:54 +0800 Subject: [PATCH 4/4] Catch exceptions and fallback --- Flow.Launcher/Notification.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher/Notification.cs b/Flow.Launcher/Notification.cs index d858e5313..ccbd005ef 100644 --- a/Flow.Launcher/Notification.cs +++ b/Flow.Launcher/Notification.cs @@ -55,20 +55,12 @@ namespace Flow.Launcher // Temporary fix for the Windows 11 notification issue // Possibly from 22621.1413 or 22621.1485, judging by post time of #2024 Log.Exception("Flow.Launcher.Notification|Notification InvalidOperationException Error", e); - if (Environment.OSVersion.Version.Build >= 22621) - { - LegacyShow(title, subTitle, iconPath); - return; - } - else - { - throw; - } + LegacyShow(title, subTitle, iconPath); } catch (Exception e) { Log.Exception("Flow.Launcher.Notification|Notification Error", e); - throw; + LegacyShow(title, subTitle, iconPath); } }