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

Core - Added --no-plugins launch parameter, this closes #574

UI - Slightly reduced input provider CPU usage
This commit is contained in:
Robert 2021-08-25 13:51:00 +02:00
parent c71a7728c4
commit 35f27b14df
3 changed files with 15 additions and 3 deletions

View File

@ -199,6 +199,12 @@ namespace Artemis.Core.Services
public void LoadPlugins(List<string> startupArguments, bool isElevated)
{
if (startupArguments.Contains("--no-plugins"))
{
_logger.Warning("Artemis launched with --no-plugins, skipping the loading of plugins");
return;
}
bool ignorePluginLock = startupArguments.Contains("--ignore-plugin-lock");
bool stayElevated = startupArguments.Contains("--force-elevation");
bool droppedAdmin = startupArguments.Contains("--dropped-admin");

View File

@ -21,6 +21,7 @@ namespace Artemis.UI.Providers
private readonly IInputService _inputService;
private readonly ILogger _logger;
private DateTime _lastMouseUpdate;
private int _lastProcessId;
private SpongeWindow _sponge;
private System.Timers.Timer _taskManagerTimer;
@ -88,9 +89,15 @@ namespace Artemis.UI.Providers
private void TaskManagerTimerOnElapsed(object sender, ElapsedEventArgs e)
{
int processId = WindowUtilities.GetActiveProcessId();
if (processId == _lastProcessId)
return;
_lastProcessId = processId;
// If task manager has focus then we can't track keys properly, release everything to avoid them getting stuck
// Same goes for Idle which is what you get when you press Ctrl+Alt+Del
Process active = Process.GetProcessById(WindowUtilities.GetActiveProcessId());
Process active = Process.GetProcessById(processId);
if (active?.ProcessName == "Taskmgr" || active?.ProcessName == "Idle")
_inputService.ReleaseAll();
}
@ -164,7 +171,7 @@ namespace Artemis.UI.Providers
private int _mouseDeltaX;
private int _mouseDeltaY;
private void HandleMouseData(RawInputData data, RawInputMouseData mouseData)
{
// Only submit mouse movement 25 times per second but increment the delta

View File

@ -1,6 +1,5 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Artemis.UI.Utilities
{