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:
parent
c71a7728c4
commit
35f27b14df
@ -199,6 +199,12 @@ namespace Artemis.Core.Services
|
|||||||
|
|
||||||
public void LoadPlugins(List<string> startupArguments, bool isElevated)
|
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 ignorePluginLock = startupArguments.Contains("--ignore-plugin-lock");
|
||||||
bool stayElevated = startupArguments.Contains("--force-elevation");
|
bool stayElevated = startupArguments.Contains("--force-elevation");
|
||||||
bool droppedAdmin = startupArguments.Contains("--dropped-admin");
|
bool droppedAdmin = startupArguments.Contains("--dropped-admin");
|
||||||
|
|||||||
@ -21,6 +21,7 @@ namespace Artemis.UI.Providers
|
|||||||
private readonly IInputService _inputService;
|
private readonly IInputService _inputService;
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private DateTime _lastMouseUpdate;
|
private DateTime _lastMouseUpdate;
|
||||||
|
private int _lastProcessId;
|
||||||
private SpongeWindow _sponge;
|
private SpongeWindow _sponge;
|
||||||
private System.Timers.Timer _taskManagerTimer;
|
private System.Timers.Timer _taskManagerTimer;
|
||||||
|
|
||||||
@ -88,9 +89,15 @@ namespace Artemis.UI.Providers
|
|||||||
|
|
||||||
private void TaskManagerTimerOnElapsed(object sender, ElapsedEventArgs e)
|
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
|
// 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
|
// 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")
|
if (active?.ProcessName == "Taskmgr" || active?.ProcessName == "Idle")
|
||||||
_inputService.ReleaseAll();
|
_inputService.ReleaseAll();
|
||||||
}
|
}
|
||||||
@ -164,7 +171,7 @@ namespace Artemis.UI.Providers
|
|||||||
|
|
||||||
private int _mouseDeltaX;
|
private int _mouseDeltaX;
|
||||||
private int _mouseDeltaY;
|
private int _mouseDeltaY;
|
||||||
|
|
||||||
private void HandleMouseData(RawInputData data, RawInputMouseData mouseData)
|
private void HandleMouseData(RawInputData data, RawInputMouseData mouseData)
|
||||||
{
|
{
|
||||||
// Only submit mouse movement 25 times per second but increment the delta
|
// Only submit mouse movement 25 times per second but increment the delta
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Artemis.UI.Utilities
|
namespace Artemis.UI.Utilities
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user