1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

UI - Fixed potential issue with fullscreen apps

Removed the MainWindowHandle constant as it was causing issues in combination with the tray icon
This commit is contained in:
SpoinkyNL 2020-08-18 23:47:45 +02:00
parent 31dd4472a8
commit 8b8fe3a3ec
4 changed files with 2 additions and 32 deletions

View File

@ -70,7 +70,5 @@ namespace Artemis.Core
typeof(double),
typeof(decimal)
};
public static IntPtr MainWindowHandle { get; internal set; }
}
}

View File

@ -125,11 +125,6 @@ namespace Artemis.Core.Services
});
}
public void SetMainWindowHandle(IntPtr handle)
{
Constants.MainWindowHandle = handle;
}
protected virtual void OnFrameRendering(FrameRenderingEventArgs e)
{
FrameRendering?.Invoke(this, e);

View File

@ -46,11 +46,5 @@ namespace Artemis.Core.Services.Interfaces
/// Occurs whenever a frame is finished rendering and processed by RGB.NET
/// </summary>
event EventHandler<FrameRenderedEventArgs> FrameRendered;
/// <summary>
/// To be called by the UI to setup the main window handle
/// </summary>
/// <param name="handle"></param>
void SetMainWindowHandle(IntPtr handle);
}
}

View File

@ -1,36 +1,29 @@
using System.Windows;
using System.Windows.Interop;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.Core.Utilities;
using Artemis.UI.Events;
using Artemis.UI.Screens.Splash;
using Artemis.UI.Shared.Controls;
using Artemis.UI.Shared.Services.Interfaces;
using MaterialDesignExtensions.Controls;
using Ninject;
using Stylet;
namespace Artemis.UI.Screens
{
public class TrayViewModel : PropertyChangedBase, IViewAware
public class TrayViewModel : Screen
{
private readonly IEventAggregator _eventAggregator;
private readonly ICoreService _coreService;
private readonly IKernel _kernel;
private readonly IWindowManager _windowManager;
private bool _setGradientPickerService;
private SplashViewModel _splashViewModel;
private bool _canShowRootViewModel;
private UIElement _view;
public TrayViewModel(IKernel kernel, IWindowManager windowManager, IEventAggregator eventAggregator, ICoreService coreService, ISettingsService settingsService)
{
_kernel = kernel;
_windowManager = windowManager;
_eventAggregator = eventAggregator;
_coreService = coreService;
CanShowRootViewModel = true;
var autoRunning = Bootstrapper.StartupArguments.Contains("--autorun");
@ -96,15 +89,5 @@ namespace Artemis.UI.Screens
{
CanShowRootViewModel = true;
}
public void AttachView(UIElement view)
{
View = view;
var handle = new WindowInteropHelper((Window) view).EnsureHandle();
_coreService.SetMainWindowHandle(handle);
}
public UIElement View { get; set; }
}
}