Sync Avalonia management features and separate desktop instances
This commit is contained in:
1 parent
0a04d5990f
commit
8d3dbe296a
12 files changed
+157
-15
No files matched your search
@@ -2,7 +2,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ads.Desktop;
|
||||
|
||||
/// <summary>Shares the Windows desktop UI lease with Flutter, including tray mode.</summary>
|
||||
/// <summary>Owns the Avalonia Windows desktop UI lease, including tray mode.</summary>
|
||||
internal sealed class DesktopInstance : IDisposable
|
||||
{
|
||||
private readonly Mutex mutex;
|
||||
@@ -10,10 +10,10 @@ internal sealed class DesktopInstance : IDisposable
|
||||
private RegisteredWaitHandle? registration;
|
||||
public bool Primary { get; }
|
||||
|
||||
public DesktopInstance()
|
||||
public DesktopInstance(string scope = @"Local\TTSTD.ADS.Avalonia")
|
||||
{
|
||||
activation = new EventWaitHandle(false, EventResetMode.AutoReset, @"Local\TTSTD.ADS.Desktop.Activate");
|
||||
mutex = new Mutex(true, @"Local\TTSTD.ADS.Desktop.Instance", out var primary);
|
||||
activation = new EventWaitHandle(false, EventResetMode.AutoReset, scope + ".Activate");
|
||||
mutex = new Mutex(true, scope + ".Instance", out var primary);
|
||||
Primary = primary;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user