diff --git a/src/Artemis.Core/Services/PluginManagementService.cs b/src/Artemis.Core/Services/PluginManagementService.cs index 5e4841829..6c528bcfe 100644 --- a/src/Artemis.Core/Services/PluginManagementService.cs +++ b/src/Artemis.Core/Services/PluginManagementService.cs @@ -199,6 +199,12 @@ namespace Artemis.Core.Services public void LoadPlugins(List 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"); diff --git a/src/Artemis.UI/Providers/NativeWindowInputProvider.cs b/src/Artemis.UI/Providers/NativeWindowInputProvider.cs index a6aa38e96..25e8f0471 100644 --- a/src/Artemis.UI/Providers/NativeWindowInputProvider.cs +++ b/src/Artemis.UI/Providers/NativeWindowInputProvider.cs @@ -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 diff --git a/src/Artemis.UI/Utilities/WindowUtilities.cs b/src/Artemis.UI/Utilities/WindowUtilities.cs index 99409febd..62dd3d4e2 100644 --- a/src/Artemis.UI/Utilities/WindowUtilities.cs +++ b/src/Artemis.UI/Utilities/WindowUtilities.cs @@ -1,6 +1,5 @@ using System; using System.Runtime.InteropServices; -using System.Text; namespace Artemis.UI.Utilities {