Skip to content

Commit

Permalink
fix: URI launchers to use the Windows implementation on Windows and t…
Browse files Browse the repository at this point in the history
…he Linux implementation on Linux
  • Loading branch information
ramezgerges committed Feb 20, 2024
1 parent 7194f4c commit 3faf589
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Uno.ApplicationModel.DataTransfer;
using System.Runtime.InteropServices;
using Uno.ApplicationModel.DataTransfer;
using Uno.Extensions.ApplicationModel.Core;
using Uno.Extensions.Storage.Pickers;
using Uno.Extensions.System;
Expand Down Expand Up @@ -40,7 +41,7 @@ internal static void Register()
ApiExtensibility.Register(typeof(ISystemThemeHelperExtension), o => new GtkSystemThemeHelperExtension(o));
ApiExtensibility.Register(typeof(Windows.Graphics.Display.IDisplayInformationExtension), o => new GtkDisplayInformationExtension(o));
ApiExtensibility.Register<TextBoxView>(typeof(IOverlayTextBoxViewExtension), o => new TextBoxViewExtension(o));
ApiExtensibility.Register(typeof(ILauncherExtension), o => new LinuxLauncherExtension(o));
ApiExtensibility.Register(typeof(ILauncherExtension), o => RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? new WindowsLauncherExtension(o) : new LinuxLauncherExtension(o));
ApiExtensibility.Register<FileOpenPicker>(typeof(IFileOpenPickerExtension), o => new FileOpenPickerExtension(o));
ApiExtensibility.Register<FolderPicker>(typeof(IFolderPickerExtension), o => new FolderPickerExtension(o));
ApiExtensibility.Register(typeof(IClipboardExtension), o => new ClipboardExtensions(o));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Windows.Storage.Pickers;
using Windows.System.Profile.Internal;
using Microsoft.UI.Xaml.Controls;
using Uno.UI.Runtime.Skia.Extensions.System;
using Uno.UI.Runtime.Skia.Wpf.Input;

namespace Uno.UI.Runtime.Skia.Wpf.Extensions;
Expand Down Expand Up @@ -49,7 +50,7 @@ internal static void Register()
ApiExtensibility.Register(typeof(IFileSavePickerExtension), o => new FileSavePickerExtension(o));
ApiExtensibility.Register(typeof(IConnectionProfileExtension), o => new WindowsConnectionProfileExtension(o));
ApiExtensibility.Register<TextBoxView>(typeof(IOverlayTextBoxViewExtension), o => new TextBoxViewExtension(o));
ApiExtensibility.Register(typeof(ILauncherExtension), o => new LauncherExtension(o));
ApiExtensibility.Register(typeof(ILauncherExtension), o => new WindowsLauncherExtension(o));
ApiExtensibility.Register(typeof(IClipboardExtension), o => new ClipboardExtensions(o));
ApiExtensibility.Register(typeof(IAnalyticsInfoExtension), o => new AnalyticsInfoExtension());
ApiExtensibility.Register(typeof(ISystemNavigationManagerPreviewExtension), o => new SystemNavigationManagerPreviewExtension());
Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UWP/System/LinuxLauncherExtension.skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Task<LaunchQuerySupportStatus> QueryUriSupportAsync(Uri uri, LaunchQueryS
}
}
// Guaranteed to work on all Linux Gtk platforms.
// Should work with most Linux environments
canOpenUri ??= CheckMimeTypeAssociations(uri);
return canOpenUri.Value ?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#nullable enable
#nullable enable

using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.Win32;
using Windows.System;
using Uno.Extensions.System;

namespace Uno.Extensions.System
namespace Uno.UI.Runtime.Skia.Extensions.System
{
internal class LauncherExtension : ILauncherExtension
internal class WindowsLauncherExtension : ILauncherExtension
{
public LauncherExtension(object owner)
public WindowsLauncherExtension(object owner)
{
}

Expand Down

0 comments on commit 3faf589

Please sign in to comment.