1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Fixed effects freezing when changing the active keyboard

This commit is contained in:
SpoinkyNL 2016-03-17 10:05:18 +01:00
parent e23a2078b7
commit c924d5120a
2 changed files with 12 additions and 19 deletions

View File

@ -120,8 +120,15 @@ namespace Artemis.Managers
private void FinishStop(object sender, RunWorkerCompletedEventArgs e)
{
UpdateWorker.RunWorkerCompleted -= FinishStop;
KeyboardManager.ReleaseActiveKeyboard();
Running = false;
if (e.Error != null || !_restarting)
return;
Start();
_restarting = false;
}
public void Pause()
@ -161,23 +168,9 @@ namespace Artemis.Managers
}
_restarting = true;
UpdateWorker.RunWorkerCompleted += FinishRestart;
Stop();
}
public void FinishRestart(object sender, RunWorkerCompletedEventArgs e)
{
UpdateWorker.RunWorkerCompleted -= FinishRestart;
if (e.Error != null)
return;
Start();
_restarting = false;
}
/// <summary>
/// Loads the last active effect and starts the program
/// </summary>

View File

@ -34,13 +34,13 @@ namespace Artemis.Modules.Effects.Debug
KeyboardRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List<Color>
{
Color.Red,
Color.OrangeRed,
Color.Yellow,
//Color.Red,
//Color.OrangeRed,
//Color.Yellow,
Color.Green,
Color.Blue,
Color.Purple,
Color.DeepPink
//Color.Purple,
//Color.DeepPink
}, LinearGradientMode.Horizontal);
Initialized = true;