Skip to content

Commit

Permalink
try catch internal interface and not use it if error thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
taooceros committed Jan 31, 2024
1 parent 9420c47 commit 756cedf
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Components/VirtualDesktopManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,19 @@ private static void Init()

private static void InitializeVirtualDesktopManagerInternal(IServiceProvider10? shell)
{
if (Environment.OSVersion.Version.Build >= 22631)
VirtualDesktopManagerInternal = (IVirtualDesktopManagerInternal?)shell?.QueryService(
Guids.CLSID_VirtualDesktopManagerInternal,
typeof(IVirtualDesktopManagerInternal).GUID);
try
{
if (Environment.OSVersion.Version.Build >= 22631)
VirtualDesktopManagerInternal = (IVirtualDesktopManagerInternal?)shell?.QueryService(
Guids.CLSID_VirtualDesktopManagerInternal,
typeof(IVirtualDesktopManagerInternal).GUID);
}
catch (Exception e)
{
Main.Context.API.LogException($"Flow.Plugin.WindowWalker.{VirtualDesktopManager}",
"Unable to load VirtualDesktopManagerInternal", e);
VirtualDesktopManagerInternal = null;
}
}

internal static IApplicationView GetApplicationView(this IntPtr hWnd)
Expand Down

0 comments on commit 756cedf

Please sign in to comment.